To take advantage of virtual threads, it is not necessary to rewrite your program. Virtual threads do not require or expect application code to explicitly hand back control to the scheduler; in other words, virtual threads are not cooperative
The JEP says this is not cooperative multi-tasking. But when you make a blocking I/O call, surely the underlying scheduling will "yield" to a different OS thread? Isn't that cooperative multi-tasking?
4
u/python_geek Apr 06 '22
The JEP says this is not cooperative multi-tasking. But when you make a blocking I/O call, surely the underlying scheduling will "yield" to a different OS thread? Isn't that cooperative multi-tasking?
Surely I am confusing something here...