3 ms·
STM is not a solution to the pain of futures, STM is a "solution" to the pain of properly using locks, in particular when the concurrency is very fine-grained.
by jaen 6y ago
STM is not a solution to the pain of futures, STM is a "solution" to the pain of properly using locks, in particular when the concurrency is very fine-grained.
A future internally is just a value or a set of waiters. Whether they are "colored" (ie. can you wait on a future in a non-future context), or based on threads or cooperative concurrency (ie. async) etc. is entirely an implementation detail, with significantly differing trade-offs.
In that sense, you can really only compare future implementations with other concurrency systems.