joyent / libuv

Go to
https://github.com/libuv/libuv
3.27k stars 653 forks source link

Utilize lock-free queue for worker thread pool #1598

Closed jnicholls closed 9 years ago

jnicholls commented 9 years ago

I think it would be far more efficient to utilize a lock-free queue (e.g. using compare-and-swap) to hand work off to the worker threads rather than using a mutex. Has this even been considered and/or benchmarked against a lock-free queue for applications that are heavily utilizing the worker thread pool for blocking file I/O, etc.?

saghul commented 9 years ago

No, this hasn't been benchmarked,but I'm curious to see some numbers :-) On Feb 9, 2015 11:23 PM, "Jarred Nicholls" notifications@github.com wrote:

I think it would be far more efficient to utilize a lock-free queue (e.g. using compare-and-swap) to hand work off to the worker threads rather than using a mutex. Has this even been considered and/or benchmarked against a lock-free queue for applications that are heavily utilizing the worker thread pool for blocking file I/O, etc.?

— Reply to this email directly or view it on GitHub https://github.com/joyent/libuv/issues/1598.

saghul commented 9 years ago

Ups, wrong project, closing.

jnicholls commented 9 years ago

Haha sorry, I mirrored it over at https://github.com/libuv/libuv/issues/188