From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 97067BB84 for ; Mon, 19 May 2008 18:30:03 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AukBAKpHMUhQRFuwiGdsb2JhbACSLwEBAQ8gmhU X-IronPort-AV: E=Sophos;i="4.27,510,1204498800"; d="scan'208";a="26354508" Received: from discorde.inria.fr ([192.93.2.38]) by mail4-smtp-sop.national.inria.fr with ESMTP; 19 May 2008 18:30:03 +0200 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by discorde.inria.fr (8.13.6/8.13.6) with ESMTP id m4JGU2V0029746 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 19 May 2008 18:30:03 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AukBAKpHMUhQRFuwiGdsb2JhbACSLwEBAQ8gmhU X-IronPort-AV: E=Sophos;i="4.27,510,1204498800"; d="scan'208";a="26354506" Received: from furbychan.cocan.org ([80.68.91.176]) by mail4-smtp-sop.national.inria.fr with ESMTP; 19 May 2008 18:30:01 +0200 Received: from rich by furbychan.cocan.org with local (Exim 4.63) (envelope-from ) id 1Jy8FM-0008Da-G5 for caml-list@inria.fr; Mon, 19 May 2008 17:30:00 +0100 Date: Mon, 19 May 2008 17:30:00 +0100 To: caml-list@inria.fr Subject: Re: [Caml-list] Re: Where's my non-classical shared memory concurrency technology? Message-ID: <20080519163000.GA31179@annexia.org> References: <200805181735.50621.jon@ffconsultancy.com> <4831686F.8010903@doc.ic.ac.uk> <1211206144.11053.15.camel@flake.lan.gerd-stolpmann.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1211206144.11053.15.camel@flake.lan.gerd-stolpmann.de> User-Agent: Mutt/1.5.13 (2006-08-11) From: Richard Jones X-Miltered: at discorde with ID 4831AB0A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; 0200,:01 gerd:01 stolpmann:01 threading:01 libs:01 wrote:01 caml-list:01 functions:01 functions:01 library:03 library:03 let:03 let:03 locks:03 locks:03 On Mon, May 19, 2008 at 04:09:04PM +0200, Gerd Stolpmann wrote: > This is simply nonsense. Different concurrency techniques have different > problems. For example, in event handling-based concurrency you do not > need locks, hence you cannot run into deadlocks. Mostly. You do however need to pay attention to which functions can schedule. Thus code like this may need a lock: let f () = let a = !global_structure in call_a_function_which_can_schedule (); global_structure := a + 1 For small programs this is manageable, but for large programs tracking functions which can schedule can be intractable. Particularly it's a problem when some fundamental function changes (eg. a fundamental function calls a logging library which changes from logging to local disk, to logging remotely -- hence starts to call schedule). My pthrlib library[1] has locks for this reason, and programs which use the library sometimes use the locks, although mostly they aren't needed. Rich. [1] Google it ... another contribution to the world of lightweight non-preemptable threading libs. -- Richard Jones Red Hat