3 ms·
The paradox of "thread local storage" is that we both really, really need it, and it blows up if you have it. Contexts are at least a value you can see and man
by jerf 3y ago
The paradox of "thread local storage" is that we both really, really need it, and it blows up if you have it.
Contexts are at least a value you can see and manipulate rather than having something attached to your thread, and in particular, can pass across thread boundaries if you need to.
One way or another, you end up needing some sort of scope that carries values that can't be strongly typed because the way you're composing those values doesn't work with any known strong type system in practical use. (I've seen some super theoretical ones that can in theory do it but I've never seen them brushed up into something practical and successful.)
- omginternets 3y agoContexts are also immutable where it matters, which helps.