[sheepdog] [PATCH 3/4] work: let worker threads start with pipe()

Liu Yuan namei.unix at gmail.com
Tue Oct 22 10:47:14 CEST 2013


On 10/22/2013 04:08 PM, Hitoshi Mitake wrote:
> At Tue, 22 Oct 2013 15:43:52 +0800,
> Liu Yuan wrote:
>>
>> On Tue, Oct 22, 2013 at 04:13:12PM +0900, Hitoshi Mitake wrote:
>>> Current work.c uses mutex for starting worker threads
>>> (startup_lock). The intention of the code is hard to understand. In
>>> addition, the code doesn't destroy newly created threads when it fails
>>> creating or growing work queues.
>>>
>>> This patch refactors the code and implement correct cleaning of
>>> threads.
>>>
>>> Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
>>> ---
>>>   lib/work.c |   59 +++++++++++++++++++++++++++++++++++++++++++----------------
>>
>> I don't see the point that you make the code simpler with pipe, you add more
>> lines than removal!
>
> My intention is that using the sequence of lock -> unlock for randezvous is
> unclear so replacing the mechanism with ordinal randezvous based on
> pipe(). In this case, I believe lines of codes doesn't matter.
>

I don't think pipe is easier to understand. pthraed_barrier would be 
better approach then.

Thanks
Yuan




More information about the sheepdog mailing list