From mboxrd@z Thu Jan 1 00:00:00 1970 From: Srinivasa T N Subject: Re: Co-thread for parallel processing Date: Fri, 02 Dec 2011 16:56:57 +0530 Message-ID: <4ED8B601.1090707@linux.vnet.ibm.com> References: Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-c-programming-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: Randi Botse Cc: linux-c-programming > 1. What the proper way to the main thread to wait for all co-threads > until finished? > 2. After calling pthread_cond_signal() or pthread_cond_broadcast() > followed by sleep()/nanosleep(), > the condition variable looks like not signaled, (the co-thread > routine doesn't run). What make this? I think you need a pthread_cond_broadcast () after do_work () in each thread. Regards, Seenu.