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 <[email protected]>
---
  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

--
sheepdog mailing list
[email protected]
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to