From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 02B35BBAF for ; Sat, 17 Jul 2010 15:50:33 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAOZRQUzV+668/2dsb2JhbACgX788hSUE X-IronPort-AV: E=Sophos;i="4.55,219,1278280800"; d="scan'208";a="54385466" Received: from rastageeks.org (HELO mail.rastageeks.org) ([213.251.174.188]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 17 Jul 2010 15:50:33 +0200 Received: from leonard.localnet (ip-102.34.99.216.dsl-cust.ca.inter.net [216.99.34.102]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.rastageeks.org (Postfix) with ESMTPSA id 373911E992; Sat, 17 Jul 2010 16:01:14 +0200 (CEST) From: Romain Beauxis To: Goswin von Brederlow Subject: Re: [Caml-list] Smart ways to implement worker threads Date: Sat, 17 Jul 2010 09:51:07 -0400 User-Agent: KMail/1.13.3 (Linux/2.6.32-4-amd64; KDE/4.4.4; x86_64; ; ) Cc: caml-list@yquem.inria.fr References: <87sk3mcaeq.fsf@frosties.localdomain> <201007160820.37108.toots@rastageeks.org> <87lj9a79y3.fsf@frosties.localdomain> In-Reply-To: <87lj9a79y3.fsf@frosties.localdomain> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <201007170951.07709.toots@rastageeks.org> X-Spam: no; 0.00; 48,:98 threads:01 threads:01 caml-list:01 implement:06 ecrit:06 thread:06 thread:06 meant:06 queue:07 mean:08 i'm:09 worker:89 worker:89 bit:11 Le samedi 17 juillet 2010 05:07:48, Goswin von Brederlow a =E9crit : > No, it couldn't. The main thread must be blocked waiting for something. > That something would either be waiting for select to return or the main > thread runs a queue and a seperate select thread and worker threads > throw tasks at it. I'm not having a main thread that checks every 0.001s > if a task happens to be done. Then use a Condition.wait on the main thread and Condition.signal in each=20 tasks. This is meant for that. I mean, there's not gonna be a ready-to-use solution for you. At some point= =20 you'll have to be a little bit creative. Romain