From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 5AE7CBC48 for ; Tue, 5 Apr 2005 20:12:39 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j35ICca1004074 for ; Tue, 5 Apr 2005 20:12:38 +0200 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 UAA06929 for ; Tue, 5 Apr 2005 20:12:38 +0200 (MET DST) Received: from saul.cis.upenn.edu (SAUL.CIS.upenn.edu [158.130.12.4]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j35ICaO4010263 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 5 Apr 2005 20:12:38 +0200 Received: from localhost (SAUL.CIS.upenn.edu [158.130.12.4]) by saul.cis.upenn.edu (8.12.10/8.12.9) with ESMTP id j35ICYCP028609; Tue, 5 Apr 2005 14:12:34 -0400 (EDT) Date: Tue, 05 Apr 2005 14:12:34 -0400 (EDT) Message-Id: <20050405.141234.38324465.eijiro_sumii@anet.ne.jp> To: caml-list@inria.fr Cc: rich@annexia.org, sumii@saul.cis.upenn.edu Subject: Re: [Caml-list] select (or polling) on in_channel? From: Eijiro Sumii In-Reply-To: <20050405143037.GB13493@furbychan.cocan.org> References: <425226CF.80708@barettadeit.com> <20050405.093439.68549116.eijiro_sumii@anet.ne.jp> <20050405143037.GB13493@furbychan.cocan.org> X-Mailer: Mew version 3.2 on Emacs 20.7 / Mule 4.1 (AOI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 4252D516.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 4252D515.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 eijiro:01 sumii:01 eijiro:01 sumii:01 threads:01 semantics:01 stack:01 setjmp:01 threads:01 ...:98 tricky:02 anet:02 asm:02 context:04 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.2 X-Spam-Level: From: "Richard Jones" > > I rather want to avoid multi-threading if select could be easy enough, > > because the former is often too tricky due to the possibility of > > deadlocks and races. > > You can implement threads on top of select / poll semantics. You also > need to have a stack switching operation (such as makecontext / > swapcontext, setjmp / longjmp, or a bit of asm). Proof by example: > http://www.annexia.org/freeware/pthrlib Yes, I think I know - my colleagues (as well as I myself) have even _taught_ how to implement threads by using select in our classes. But how is that relevant in this context? It doesn't mean multi-threading is always easier than select (in my case, for instance)...? Eijiro