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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 29C45BBAF for ; Thu, 15 Jul 2010 18:31:35 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArMEADTUPkzV+668/2dsb2JhbACTK40qvzGFJASDfocS X-IronPort-AV: E=Sophos;i="4.55,209,1278280800"; d="scan'208";a="63856943" Received: from rastageeks.org (HELO mail.rastageeks.org) ([213.251.174.188]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 15 Jul 2010 18:31:35 +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 41E0A40A07 for ; Thu, 15 Jul 2010 18:42:01 +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 11:32:07 -0500 User-Agent: KMail/1.13.3 (Linux/2.6.32-4-amd64; KDE/4.4.4; x86_64; ; ) References: <87sk3mcaeq.fsf@frosties.localdomain> In-Reply-To: <87sk3mcaeq.fsf@frosties.localdomain> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <201007151132.07821.toots@rastageeks.org> X-Spam: no; 0.00; scheduler:01 implements:01 scheduler:01 threads:01 threads:01 caml-list:01 define:02 modules:02 implemented:02 match:02 seems:03 module:03 implement:06 queues:06 ecrit:06 Hi ! Le mercredi 14 juillet 2010 11:09:49, Goswin von Brederlow a =E9crit : > 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 g= ive=20 seems to match the requirements we had in liquidsoap when we implemented ou= t=20 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= =20 where you can define your custom priorities, create a queue for a certain r= ange=20 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=20 associated queues and submit tasks to the scheduler. Romain