Cooperative vs preemtive scheduling of virtual theads
Alan Bateman
Alan.Bateman at oracle.com
Mon Jun 8 15:09:56 UTC 2020
On 08/06/2020 14:48, Andrey Lomakin wrote:
>
> And one more question, is it situation which described by Andrew
> really holds ? I thought that executors by current design does not
> recognize such situations (which for example causes the current
> problem with synchronized)
> and do not switch execution of virtual theads and that happens during
> direct calls to the locks and during calls of IO operations ? And is
> it possible that this behaviour will be kept as the "by design" or can
> be changed once project will evolve ? I mean is it true that during
> exectuion of such operation as class loading execution of one virtual
> thread will be swithced to the execution of other virtual thread,
> especially if the backed by the single thread carrier ?
Yes, it's possible in theory but unlikely in the current implementation
because of the limitation that the thread is pinned while holding a
monitor (ClassLoaders will almost always be holding a monitor when
loading classes).
-Alan.
More information about the loom-dev
mailing list