true. but when JVM is running (with green threads), as it multiplexes all the requests onto only one O/S thread, does it mean that it doesn't block on IO? if so, how does it manage to do IO on O/S which doesn't support asynchronous IO (I am not sure if there are any O/Ss of that kind) unlike windows and Unix (which have poll and select system calls)
> true. but when JVM is running (with green threads), as it multiplexes all the requests onto only one O/S
> thread, does it mean that it doesn't block on IO? if so, how does it manage to do IO on O/S which doesn't
> support asynchronous IO (I am not sure if there are any O/Ss of that kind) unlike windows and Unix (which
> have poll and select system calls)
Good question. Actually, it can't work very well on OSes where you can't issue asynchronous I/O calls. Or where they work in an "unexpected" fashion.
The green threads port to HP-UX 10.20 (which didn't have threading support, and whose async I/O worked differently from Solaris') was extremely flaky for a while. While it did improve, there were still lots of interesting problems because of this.
Anyway, this only a matter for intellectual curiosity now. While there may still be a few HP-UX 10.20 installations out there, they are few and far in between. And they'll only support JDK 1.1, and may be 1.2.x. Recent JDK releases only support the HotSpot VM, which requires native threads in the OS.