News for hackers. Stuff that matters.
Re:Project Loom and Structured Concurrency by jnwatson on Friday December 04, 2020 @09:39AM (#25302654)
Async, and cooperative multitasking in general, requires all members participate in the contract: you shall not block and you shall not go too long until yielding. Once a piece of code violates that, all bets are off. Python has explicit debugging mechanisms to help a developer detect the latter.

Cancel safety is less about killing an out-of-control task, and more about making sure the state after cancelling a task is consistent.

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?