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 B4170BCB0 for ; Mon, 13 Jun 2005 00:02:40 +0200 (CEST) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.199]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j5CM2dXO015433 for ; Mon, 13 Jun 2005 00:02:40 +0200 Received: by rproxy.gmail.com with SMTP id a36so717056rnf for ; Sun, 12 Jun 2005 15:02:39 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=TT2PoXmzuWAhYf3+kE1ajSLPb8Onn/pMVh/EmS017xvCbTBaJfXodpolEUuxOIE4+J3KEJzUj942c9aiwCkXd9ff3RIvfL1ktxQbm9tDtDMIgCig2TbuSYu/BWdACs7YVDNehtZOuFdkz9/s926yYI4kplG+AdgWm3vtxe4xJkE= Received: by 10.38.75.33 with SMTP id x33mr691840rna; Sun, 12 Jun 2005 15:02:39 -0700 (PDT) Received: by 10.38.209.44 with HTTP; Sun, 12 Jun 2005 15:02:39 -0700 (PDT) Message-ID: Date: Mon, 13 Jun 2005 10:02:39 +1200 From: Jonathan Roewen Reply-To: Jonathan Roewen To: Richard Jones Subject: Re: [Caml-list] Pre-emptive multitasking Cc: caml-list@yquem.inria.fr In-Reply-To: <20050612101323.GA21947@furbychan.cocan.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <20050612101323.GA21947@furbychan.cocan.org> X-Miltered: at nez-perce with ID 42ACB0FF.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 thread-safe:01 thread-safe:01 runtime:01 ocaml:01 threads:01 ocaml:01 runtimes:01 threads:01 scheduler:01 threading:01 runtime:01 multitasking:98 ...:98 outs:98 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=RCVD_BY_IP autolearn=disabled version=3.0.2 X-Spam-Level: > The GC isn't thread-safe.=20 What would it take to make it thread-safe? I plan to make a custom native code runtime anyway, so could try working on that problem too... > This means that when OCaml code runs, it > must be protected by a global mutex. If you have two threads running > OCaml code, they will contend for this mutex, and run (around) 50% of > the time each. If you have two CPUs you won't gain any benefit.=20 We plan on running separate runtimes for multi-processor systems. > The standard solution would be to run one OCaml thread and lots of C > threads This is not a solution: we're going for an almost pure OCaml operating system (need asm, etc). I'm more interested in the ins and outs of the scheduler for pure OCaml threading. Such as, is it pre-emptive or co-operative? What kind of runtime guarantees can it provide for near realtime applications, etc. Jonathan