4 ms·
But compare this very recent submission: https://news.ycombinator.com/item?id=24921657 https://news.ycombinator.com/item?id=24921657 which presents threads as
by thaumasiotes 6y ago
But compare this very recent submission: https://news.ycombinator.com/item?id=24921657 https://news.ycombinator.com/item?id=24921657
which presents threads as the solution to the pain of using futures.
- jaen 6y agoSTM 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.