Issue w/ Recursive Virtual Thread Spawning
Ryan Schmukler
ryan at teknql.com
Wed Apr 19 14:38:56 UTC 2023
Hello,
I am not sure if this is the appropriate venue or if I should be reporting
bugs via the Oracle bug page. Apologies if this is incorrect; this is also
my first mailing list.
I am the author of a library that brings Loom related functionality into
Clojure: https://github.com/teknql/tapestry
I recently stumbled upon an interesting behavior where recursively spawning
fibers can cause the program to block infinitely. The (clojure) code that
can reproduce this can be seen at this gist:
https://gist.github.com/rschmukler/314b786206246c906caa6a2f99d731a7
Basically if you have 4 virtual threads that recursively spawn 4 virtual
threads, which recursively spawn 4 virtual threads, which recursively
spawn 4 virtual threads, you will hit some sort of blocking issue and your
code will freeze. 4^4 = 256 virtual threads which I think should be very
doable for Loom.
In case it matters here are the versions and system issue:
OpenJDK 19.0.2 and OpenJDK 20.0.1
Linux 6.1.21
16 (w/ hyperthreading) cores.
Again apologies if this isn't the appropriate forum to report this (wasn't
sure since Loom is in preview still). I really appreciate all that you are
doing to bring virtual threads to the JVM.
Cheers,
Ryan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/loom-dev/attachments/20230419/fc95b130/attachment.htm>
More information about the loom-dev
mailing list