|
|
|
|
|
by bberrry
695 days ago
|
|
I don't think that's correct. ThreadLocals should behave just like on regular OS threads, the difference is that you can suddenly create millions of them. You used to be able to depend on OS threads getting reused because you were pooling them. You can do the same with virtual threads if you wish and you will get the same behavior. The difference is we ought to spawn new threads per task now. Side note, you have to specifically use InheritableThreadLocal to get the inheritance behavior you speak of. |
|