threadpool icon indicating copy to clipboard operation
threadpool copied to clipboard

Why bother with a chan chan of workers?

Open SSSCeph opened this issue 4 years ago • 1 comments

https://github.com/shettyh/threadpool/blob/b99fd8aaa9451aabc3d737e614c9a24a44d2a84c/threadpool.go#L15

Wouldn't it be simpler to just have workers pull jobs off the job queue instead of a double redirect / dispatch? (get job, find worker, queue job).

SSSCeph avatar Jan 21 '22 12:01 SSSCeph

https://github.com/shettyh/threadpool/blob/b99fd8aaa9451aabc3d737e614c9a24a44d2a84c/threadpool.go#L15

Wouldn't it be simpler to just have workers pull jobs off the job queue instead of a double redirect / dispatch? (get job, find worker, queue job).

i think workerPool is like the manager between jobQueue and worker, because of workerPool.size = threadPool.size

masterdrone1999 avatar Jul 16 '22 02:07 masterdrone1999