Re:Project Loom and Structured Concurrency
by didibus on Saturday December 05, 2020 @06:42PM
(#25319512)
> you shall not block and you shall not go too long until yielding
Arn't those effectively the same?
I think the only contract is "you shall not go too long until yielding". Or if you're designing for performance, not for responsiveness, it might be: "you shall not hold unto CPU and IO resources that you're not using".
Re:Project Loom and Structured Concurrency
by jayd16 on Friday December 04, 2020 @12:20PM
(#25305015)
>you shall not block and you shall not go too long until yielding
Eh... you as the caller have control on how a task is run. If you want it on a different thread and non-blocking, or simply deferred, you can. You have a lot of control.
With an implicit system you have much less control. Loom seems to solve this by letting you explicitly schedule tasks anyhow?
Cancel safety is less about killing an out-of-control task, and more about making sure the state after cancelling a task is consistent.