FileDescriptor.sync isn't using Blocker

Alan Bateman Alan.Bateman at oracle.com
Fri Jul 14 08:55:29 UTC 2023


On 13/07/2023 20:23, Cay Horstmann wrote:
>
> I re-read this a few times. Here is where I think there is confusion.
>
> The first paragraph "The vast majority..." states: "However, some 
> blocking operations in the JDK do not unmount the virtual thread, and 
> thus block both its carrier and the underlying OS thread." It then 
> goes on to say that the parallelism level expands.

This is paragraph 6, is is correct.


>
> The following paragraph states: "There are two scenarios in which a 
> virtual thread cannot be unmounted during blocking operations because 
> it is pinned to its carrier:" In a subsequent paragraph: "The 
> scheduler does not compensate for pinning by expanding its parallelism."

This paragraph is also correct it but I think what you are saying is 
that the discussion about expanding parallelism for OS operations that 
doesn't release the carrier is sticking in the reader's mind when they 
move onto the next paragraph about these two operations. We can look at 
this again to see if we can structure it better.


>
> It is unclear what readers should avoid. Are synchronized 
> methods/blocks always an impediment to virtual threads? Or only if 
> their body calls wait?
We try to summary the advice on synchronized in this section. It's just 
not an issue when used infrequently or guarding in-memory operations. 
It's mostly just an issue, and often just a quality of implementation 
issue, when parking while holding a monitor. Work is in progress to 
address that limitation, no timeframe on that yet.

-Alan


More information about the loom-dev mailing list