Inline WorkerThread pointer into a thread local#155688
Inline WorkerThread pointer into a thread local#155688zetanumbers wants to merge 1 commit intorust-lang:mainfrom
Conversation
|
r? @chenyukang rustbot has assigned @chenyukang. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
r? @nnethercote |
|
Doesn't seem to influence the performance overall, but noise level is a bit too big on my machine. Perhaps @Zoxc has better environment.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Also I haven't yet updated comments. TODO |
|
I was thinking a scoped thread local would make sense for this too. cc @cuviper in case that makes sense for upstream Rayon. My guess is that the indirection doesn't have much performance overhead. A Rayon benchmark would be more suitable, but not sure it would pick that up. |
|
I am uncertain about the status of this PR. @zetanumbers: has the TODO on the comments been addressed?
Is that a suggestion for a change to this PR, or a follow-up, or something else? @rustbot author |
|
Reminder, once the PR becomes ready for a review, use |
I've got this idea while implementing #155649. It's not as clean as I've expected but it did get rid of many unsafe blocks. I can also remove these unsafe blocks without changing
WORKER_THREAD_STATE's type by utilizing new safeWorkerThreadfunctions.