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 EB5C2BBAF for ; Thu, 15 Jul 2010 19:46:55 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkQCAMnlPkzZSMDqkWdsb2JhbACfZBUBAQEBCQsKBxEDH79JhSQE X-IronPort-AV: E=Sophos;i="4.55,209,1278280800"; d="scan'208";a="54301187" Received: from fmmailgate03.web.de ([217.72.192.234]) by mail3-smtp-sop.national.inria.fr with ESMTP; 15 Jul 2010 19:46:55 +0200 Received: from smtp06.web.de ( [172.20.5.172]) by fmmailgate03.web.de (Postfix) with ESMTP id E9F6315B78421; Thu, 15 Jul 2010 19:46:54 +0200 (CEST) Received: from [78.43.204.177] (helo=frosties.localdomain) by smtp06.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.110 #4) id 1OZSWM-00053j-00; Thu, 15 Jul 2010 19:46:54 +0200 Received: from mrvn by frosties.localdomain with local (Exim 4.72) (envelope-from ) id 1OZSWL-0006oh-CD; Thu, 15 Jul 2010 19:46:53 +0200 From: Goswin von Brederlow To: Romain Beauxis Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Smart ways to implement worker threads References: <87sk3mcaeq.fsf@frosties.localdomain> <201007151132.07821.toots@rastageeks.org> Date: Thu, 15 Jul 2010 19:46:53 +0200 In-Reply-To: <201007151132.07821.toots@rastageeks.org> (Romain Beauxis's message of "Thu, 15 Jul 2010 11:32:07 -0500") Message-ID: <874og0hc36.fsf@frosties.localdomain> User-Agent: Gnus/5.110009 (No Gnus v0.9) XEmacs/21.4.22 (linux, no MULE) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Sender: goswin-v-b@web.de X-Sender: goswin-v-b@web.de X-Provags-ID: V01U2FsdGVkX18v9hkirMPt4NOgfGGhOhYKQntKSsxZaGzsWVO4 AB3gxmZaA8BNRZaMKJaPU5IaDQPr5pHIOaEvdrxmVqBaYJtQQF 9Qy+2XlJs= X-Spam: no; 0.00; scheduler:01 implements:01 scheduler:01 mfg:98 threads:01 threads:01 caml-list:01 writes:01 define:02 modules:02 implemented:02 match:02 seems:03 seems:03 module:03 Romain Beauxis writes: > Hi ! > > Le mercredi 14 juillet 2010 11:09:49, Goswin von Brederlow a écrit : >> What do you think? Other Ideas? Ready-to-use modules for this? > > I won't commend on CML; which I don't know at all but the description you give > seems to match the requirements we had in liquidsoap when we implemented out > internal scheduler. > > The module that implements it is there: > http://www.rastageeks.org/ocaml-duppy/Duppy.html > > Basically, it provides a facility around to create a select-based scheduler > where you can define your custom priorities, create a queue for a certain range > of priority and run them in threads. > > The main scheduling is done by inside the tasks, so this is transparent. > > Basically, to use it, you initiate a scheduler, create threads running > associated queues and submit tasks to the scheduler. > > > Romain 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. 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. MfG Goswin