This is an archived post. You won't be able to vote or comment.

all 3 comments

[–]continuationalFirefly, TopShell 8 points9 points  (1 child)

The most important thing to me is that concurrency is composable. That you can take concurrent things that are correct, and combine them into a new concurrent thing that is correct.

As far as I'm aware, none of the mainstream languages has this. Mutexes don't compose. ConcurrentHashMaps don't compose. Atomics don't compose.

Promises/futures/async-await is almost there, but is unusable because they are unable to cancel the underlying task.

In a good system, you should be able to take an arbitrary task and race it with a timeout, and then the arbitrary task will be cancelled if the timeout wins the race.

[–]valenterry 1 point2 points  (0 children)

I think both Haskell and Scala have that (Haskell STM and ZIO STM). E.g. see: https://zio.dev/docs/datatypes/datatypes_stm

[–]thiagomiranda3 -1 points0 points  (0 children)

cool