From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 95493BB91 for ; Mon, 17 Jan 2005 13:33:32 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j0HCXW6Z010859 for ; Mon, 17 Jan 2005 13:33:32 +0100 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id NAA21863 for ; Mon, 17 Jan 2005 13:33:31 +0100 (MET) Received: from smtp005.mail.ukl.yahoo.com (smtp005.mail.ukl.yahoo.com [217.12.11.36]) by concorde.inria.fr (8.13.0/8.13.0) with SMTP id j0HCXV8h010856 for ; Mon, 17 Jan 2005 13:33:31 +0100 Received: from unknown (HELO ?10.0.0.115?) (pasckosky@213.255.109.130 with plain) by smtp005.mail.ukl.yahoo.com with SMTP; 17 Jan 2005 12:33:31 -0000 Message-ID: <41EBB09A.6080803@barettadeit.com> Date: Mon, 17 Jan 2005 13:33:30 +0100 From: Luca Pascali User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20041007 Debian/1.7.3-5 X-Accept-Language: en MIME-Version: 1.0 To: caml-list@inria.fr Subject: Re: [Caml-list] Mutex and posix References: <41E501B4.4060601@yahoo.it> <41E957C5.6050808@barettadeit.com> In-Reply-To: <41E957C5.6050808@barettadeit.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 41EBB09C.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 41EBB09B.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 posix:01 baretta:01 wrote:01 wrote:01 posix:01 mutexes:01 const:01 struct:01 simulate:01 synchronous:01 baretta:01 machiavelli:98 machiavelli:98 unix:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: Alex Baretta wrote: > Luca Pascali wrote: > >> Just a little question, my curiosity about the thread module. >> >> I found in Posix (this is from 'info libc' page on section Mutexes) >> these three functions >> >> Function: int pthread_mutex_lock (pthread_mutex_t *mutex)) >> Function: int pthread_mutex_trylock (pthread_mutex_t *MUTEX) >> Function: int pthread_mutex_timedlock (pthread_mutex_t *MUTEX, const >> struct timespec *ABSTIME) > > > You can probably simulate the third one fairly well by resorting to > Unix.select as a timer, but why in the world would you want to lock > for a while and then forget about it? > > Besides --- given Machiavelli works in an asynchronous, event-modeled > world --- why would want to use synchronous primitives such as timedlock? > > Alex > > It's not about Machiavelli. It was just a curiosity (We spoken personally a few months ago). I staied with the doubt about the missing of this function and I thought that asking to the list was the best thing to do for having an answer. And it was. Luca -- ********************************************************************* Luca Pascali luca@barettadeit.com asxcaml-guru@barettadeit.com http://www.barettadeit.com/ Baretta DE&IT A division of Baretta SRL tel. 02 370 111 55 fax. 02 370 111 54 Our technology: http://www.asxcaml.org/ http://www.freerp.org/