From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id BAA19547; Fri, 21 Feb 2003 01:15:40 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 BAA19577 for ; Fri, 21 Feb 2003 01:15:39 +0100 (MET) Received: from favie.faith.gr.jp (favie.faith.gr.jp [61.127.175.250]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h1L0FbH28191 for ; Fri, 21 Feb 2003 01:15:38 +0100 (MET) Received: from localhost (dhcp7.faith.gr.jp [192.168.1.17]) by favie.faith.gr.jp (8.9.3/8.9.3) with ESMTP id JAA06800; Fri, 21 Feb 2003 09:15:30 +0900 To: shiv@ece.ucsb.edu Cc: caml-list@inria.fr Subject: Re: [Caml-list] native threads not parallel? In-Reply-To: <847A10BA-4528-11D7-8C93-000393942C76@ece.ucsb.edu> References: <847A10BA-4528-11D7-8C93-000393942C76@ece.ucsb.edu> X-Mailer: Mew version 1.94.2 on Emacs 21.2 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20030221091524C.garrigue@kurims.kyoto-u.ac.jp> Date: Fri, 21 Feb 2003 09:15:24 +0900 From: Jacques Garrigue X-Dispatcher: imput version 20000228(IM140) Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk From: Shivkumar Chandrasekaran > not. But I seem to have the same problem as discussed by Markus Mottl > (see attachment below) on Mac OS X 10.2.4 on a dual processor G4 > machine. An earlier message in that thread mentioned that there was no > such problem on dual-processor Linux machines. Let's answer again, since this is a frequent question: ocaml threads do not not support parrallelism. Only one ocaml thread will run at a time, independently of the number of processors, and this on any architecture/OS. > > From :Markus Mottl < mottl@miss.wu-wien.ac.at > > > The only thing I can imagine is that OCaml somehow changes > > scheduling so that the threads cannot run in parallel anymore, even if > > "enter_blocking_section" is used. Is this possible? Or am I just making > > some stupid mistake? enter_blocking_section only happens in C code, and is followed by a leave_blocking_section before returning to caml code. Since the leave_blocking_section reacquires the lock, no more than one ocaml thread can run simultaneously. Easy way to crash the runtime: call a caml callback immediately after an enter_blocking_section. The two caml threads will start to allocate simultaneously on the same heap, without any locking... Jacques Garrigue ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners