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 9B8C9BBAF for ; Fri, 16 Jul 2010 16:41:54 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuYAAB4MQEzUTWUHkWdsb2JhbACDHoJimWkVAQEBAQkLCgcRBB6tdpE6gSmDCXIE X-IronPort-AV: E=Sophos;i="4.55,215,1278280800"; d="scan'208";a="63914344" Received: from mx3.wp.pl ([212.77.101.7]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 16 Jul 2010 16:41:54 +0200 Received: (wp-smtpd smtp.wp.pl 23939 invoked from network); 16 Jul 2010 16:41:47 +0200 Received: from pfpleia.if.uj.edu.pl (HELO [149.156.90.26]) (d0@[149.156.90.26]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with AES256-SHA encrypted SMTP for ; 16 Jul 2010 16:41:47 +0200 Message-ID: <4C406F46.3090907@wp.pl> Date: Fri, 16 Jul 2010 16:40:06 +0200 From: Dawid Toton User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.10) Gecko/20100528 Thunderbird/3.0.5 MIME-Version: 1.0 To: caml-list Subject: Re: Smart ways to implement worker threads References: <87sk3mcaeq.fsf@frosties.localdomain> <87zkxsfvsg.fsf@frosties.localdomain> <87hbk0vzut.fsf@frosties.localdomain> <87630fbmvb.fsf@frosties.localdomain> In-Reply-To: <87630fbmvb.fsf@frosties.localdomain> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [0XOU] X-Spam: no; 0.00; threads:01 functions:01 constructs:02 module:03 threaded:03 thread-safe:05 implement:06 thread:06 queue:07 queue:07 elaborate:07 odd:09 worker:89 yet:12 version:13 > I find it odd that there is no Threaded_Queue module, a thread save > version of Queue with 2 extra functions: (...) > I use such a thread-safe queue a lot [1]. This is very simple yet universal enough. Honestly I can hardly remember using more elaborate constructs. Dawid [1] http://pfpleia.if.uj.edu.pl/projects/HLibrary/browser/HQueue.ml