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 BC2BABCAF for ; Sat, 11 Jun 2005 19:09:57 +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 j5BH9vP6026664 for ; Sat, 11 Jun 2005 19:09:57 +0200 Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA15385 for ; Sat, 11 Jun 2005 19:09:57 +0200 (MET DST) Received: from mailx.valdosta.edu (mailx.valdosta.edu [168.18.130.251]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j5BH9utl026657 for ; Sat, 11 Jun 2005 19:09:56 +0200 Received: from blazemail.valdosta.edu (valdosta.edu [168.18.130.208]) by mailx.valdosta.edu (8.13.4/8.13.4) with ESMTP id j5BH9sAp026606 for ; Sat, 11 Jun 2005 13:09:55 -0400 (EDT) (envelope-from jtbryant@valdosta.edu) Disposition-notification-to: jtbryant@valdosta.edu Received: from luminis (luminis [168.18.130.219]) by blazemail.valdosta.edu (iPlanet Messaging Server 5.2 HotFix 2.04 (built Feb 8 2005)) with SMTP id <0IHX0015EJOIDZ@blazemail.valdosta.edu> for caml-list@inria.fr; Sat, 11 Jun 2005 13:09:54 -0400 (EDT) Date: Sat, 11 Jun 2005 13:09:54 -0400 (EDT) From: Jonathan T Bryant Subject: Threads vs. Fork To: caml-list@inria.fr Message-id: <132925.1118509794764.JavaMail.jtbryant@valdosta.edu> MIME-version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7BIT X-PMX-Version: 5.0.1.144180, Antispam-Engine: 2.0.3.2, Antispam-Data: 2005.6.11.11 X-Miltered: at nez-perce with ID 42AB1AE5.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 42AB1AE4.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; threads:01 threads:01 ocaml:01 api:01 ...:98 unix:01 essentially:01 data:02 exists:02 tree:02 tree:02 fork:04 fork:04 shared:04 shared: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: The reason I asked about the threads is because I need the shared memeory, but I also need to use multiple processors. Essentially, I'm writing a mini-database. There's a shared data structure (a tree of some description) and a bunch of workers that perform lookups. Every time there's an update to the tree, all of the workers need to be blocked until the update is completed (pretty standard stuff). I can do this with fork if I can have shared memory, or I can do this with threads if I can use multiple processors. Apparenly, neither option exists in OCaml. Any suggestions on how to resolve this? Does somebody have an extended Unix API that includes things like shared memory (shmget(), shmat(), etc...) --Jonathan