Re:JEP proposed to target JDK 19: 425: Virtual Threads (Prev...
by jayd16 on Monday May 02, 2022 @10:03PM
(#31243572)
>you take on all the complexities of threads
Well no, not _all_ of the complexities because you have await and explicit yielding. It's much easier to pass data from one asynchronous task to another using await than it is to, say, manually code the locks or state machine necessary for the message passing and/or callbacks.
Re:JEP proposed to target JDK 19: 425: Virtual Threads (Prev...
by Spivak on Tuesday May 03, 2022 @12:14AM
(#31244532)
Await and explicit yielding do nothing as soon as you want to actually run multiple tasks at the same time in parallel instead of sequentially but interleaved.
Well no, not _all_ of the complexities because you have await and explicit yielding. It's much easier to pass data from one asynchronous task to another using await than it is to, say, manually code the locks or state machine necessary for the message passing and/or callbacks.