Closed kohlschuetter closed 4 months ago
The latest 2.10.0-SNAPSHOT should remedy this situation. Threads should no longer block each other if both the client and server run on VirtualThreads, and the test code provided seems to work now.
What's still missing is an optimized version of poll
for systems that support kqueue
, epoll
, /dev/poll
, etc. Right now, we simply move the poll
to a separate non-virtual Thread, which is suboptimal, but does indeed work.
@cenodis Please verify with the latest 2.10.0-SNAPSHOT.
Works great on my (linux) machine. Junixsocket no longer causes the program to lock up. I have also put it through a few random scenarios and can't detect any pinning, although it's not an exhaustive test by any means.
As you said, optimizations are still possible. But junixsocket should no longer negatively affect other virtual threads running on the system. So at this point I would say virtual threads are properly supported and anything else is an internal detail of junixsocket.
That being said there is still a divergence in interrupt behaviour. In my opinion this is not directly related to supporting virtual threads but it's still a fairly important detail, especially with the structured concurrency (preview) feature bringing a bigger emphasis on interruptions. I am going to collect a bit more information on this topic and then open a seperate issue for it.
@kohlschuetter Hi, any plans to release 2.10 with the fix soon?
@urbanchef Should be ready in a few days, sorting out a couple of remaining issues first.
Please try the latest SNAPSHOT version and let me know if you find any problems with it. Thanks!
junixsocket 2.10.0 has been released. Please verify and re-open if necessary. Thanks again for reporting , @cenodis !
VirtualThreads may block.
From https://github.com/kohlschutter/junixsocket/discussions/155, @cenodis writes: