3 ms·
Yeah as I alluded to, libraries are the thing that hamper this style. You don't control all the code in your application. But it's not too hard to work around
by chubot 9y ago
Yeah as I alluded to, libraries are the thing that hamper this style. You don't control all the code in your application. But it's not too hard to work around.
I also think language-supported thread locals are superfluous in this style. Instead, just create a single object that runs into a single thread. Then you don't pass the object to any other threads. The members are automatically thread locals.
If you have N threads, then you have N objects confined to those threads. There doesn't need to be a separate concept of thread-local IMO.
- weberc2 9y agoYeah, this is a huge benefit, especially in a language like Go where concurrency is cheap and common.