[sheepdog] [PATCH] sheep: introduce 'short thread' to worker threads

Liu Yuan namei.unix at gmail.com
Tue Jul 3 18:47:08 CEST 2012


On 07/04/2012 12:26 AM, Christoph Hellwig wrote:
> Sorry for being late to the discussion, but creating a new thread for
> every queued work item is a massive scalability problem.  I don't mind
> growing / shrinking the pool dynamically, but having to create a thread
> for every single request is going to hit the kernel really hard.
>

What is consequence of 'hit the kernel really hard'? overhead of clone()
system call? For thread pool, we also hit hard on mutex(futex) and
pthread condition.

> We'll at least need to keep a pool of available threads around.
> 

It is not hard to implement it, but do we really need threads pool? And
more importantly, why? I think kernel's thread model is capable of
handling frequent thread creation and destroying in terms of task_struct
and kernel stack for thread. Also pthreads has internal resource
pooling, so speaking about performance, I don't think it is not inferior
compared to static thread pool.

Thanks,
Yuan



More information about the sheepdog mailing list