Native methods and virtual threads
Brian S O'Neill
bronee at gmail.com
Thu Jul 13 22:13:03 UTC 2023
That's a good clarification. I didn't mean to imply that a thread with a
native frame could be unmounted, but rather, that an "is blocking" hint
could be specified. This in turn might call into the Blocker class just
like Java file I/O does.
On 2023-07-13 03:00 PM, Jorn Vernee wrote:
> > 2. When it executes a native method or a foreign function.
>
> Note that either way we can never unmount a virtual thread that has
> native frames on the stack. In native code it is possible to have
> pointers into the thread stack. These pointers would be left dangling if
> the virtual thread, and its native frames, were unmounted from the
> carrier thread. The 'Blocker' API just signals to the thread pool that a
> carrier thread belongs to, that more carrier threads should be spawned
> to compensate for the blocked carrier thread.
>
More information about the panama-dev
mailing list