From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr 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 2C443BBAF for ; Thu, 15 Jul 2010 20:43:40 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArMEAM7zPkzV+668/2dsb2JhbACTMY0sv0iFJASDfocS X-IronPort-AV: E=Sophos;i="4.55,209,1278280800"; d="scan'208";a="54302840" 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; 15 Jul 2010 20:43:39 +0200 Received: from leonard.localnet (unknown [129.81.170.252]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.rastageeks.org (Postfix) with ESMTPSA id C69ED42E8C for ; Thu, 15 Jul 2010 20:54:06 +0200 (CEST) From: Romain Beauxis To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Smart ways to implement worker threads Date: Thu, 15 Jul 2010 13:44:12 -0500 User-Agent: KMail/1.13.3 (Linux/2.6.32-4-amd64; KDE/4.4.4; x86_64; ; ) References: <87sk3mcaeq.fsf@frosties.localdomain> <201007151132.07821.toots@rastageeks.org> <874og0hc36.fsf@frosties.localdomain> In-Reply-To: <874og0hc36.fsf@frosties.localdomain> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <201007151344.12726.toots@rastageeks.org> X-Spam: no; 0.00; scheduler:01 threads:01 threads:01 caml-list:01 seems:03 seems:03 overhead:04 timeout:05 timeout:05 anyway:05 implement:06 ecrit:06 thread:06 queue:07 queue:07 Le jeudi 15 juillet 2010 12:46:53, Goswin von Brederlow a =E9crit : > I don't see where that helps at all. I don't want to offload the IO into > threads and schedule them and Duppy seems to only handle IO tasks. I don't understand what you mean by IO tasks. Tasks in duppy are scheduled= =20 according to some events which, since it is select-based, are either an eve= nt=20 on a socket or a timeout. Once scheduled, the action that the task does is anything you programmed. O= nce=20 finished, the tasks can return an array of new tasks which are then put in = the=20 queue. In your case, you probably only need the timeout event, which would mean th= at=20 as soon as you have a new tasks to perform, you submit it to the scheduler= =20 with timeout 0 and it will be processed by one of the threads as soon as=20 possible.. > Except if I pick Solution 1 and then it still doesn't help anything > since I can already run select in every thread. The IO should not be > scheduled by priorities and isn't the bottleneck anyway. Seems this > would just add overhead. The idea of duppy was to have only one select running among the multiple qu= eue=20 threads. Romain