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 KAA20537; Tue, 26 Nov 2002 10:29:28 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f 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 KAA20784 for ; Tue, 26 Nov 2002 10:29:27 +0100 (MET) Received: from mel-rto4.wanadoo.fr (smtp-out-4.wanadoo.fr [193.252.19.23]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id gAQ9TQX22235; Tue, 26 Nov 2002 10:29:26 +0100 (MET) Received: from mel-rta8.wanadoo.fr (193.252.19.79) by mel-rto4.wanadoo.fr (6.5.007) id 3DDA133F0046DA40; Tue, 26 Nov 2002 10:29:26 +0100 Received: from iliana (80.14.205.45) by mel-rta8.wanadoo.fr (6.5.007) id 3DD0D427008207EA; Tue, 26 Nov 2002 10:29:26 +0100 Received: from luther by iliana with local (Exim 3.36 #1 (Debian)) id 18Gc20-0001RC-00; Tue, 26 Nov 2002 10:29:24 +0100 Date: Tue, 26 Nov 2002 10:29:24 +0100 To: Xavier Leroy Cc: Blair Zajac , caml-list@inria.fr Subject: Re: [Caml-list] Why systhreads? Message-ID: <20021126092924.GA5383@iliana> References: <20021123090806.GA633@la.iki.fi> <20021125110133.A12077@pauillac.inria.fr> <3DE2736D.F4FCC064@orcaware.com> <20021126100254.A19708@pauillac.inria.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021126100254.A19708@pauillac.inria.fr> User-Agent: Mutt/1.4i From: Sven Luther Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, Nov 26, 2002 at 10:02:54AM +0100, Xavier Leroy wrote: > Blair Zajac wrote: > > > To summarize, for (2) system threads are required and and you can't > > prevent blocking with user level threads easily or at all. For (3), > > making the Ocaml system support SMP is "Too complex; too hard to > > debug" and SMP boxes aren't all that popular. > > Aren't these contradictory statements? > > > > For Ocaml to support a Ocaml program to have one thread to block on a > > system call and to allow other threads to continue, doesn't this support > > SMP? Does Ocaml support this? > > No to the first question. Yes to the second. > > By "supporting SMP", I mean having several threads executing Caml code > in parallel, thus using the Caml runtime system in a concurrent fashion. > This is the hard part. > > In the current implementation of systhreads, the Caml executor and > runtime system is one big critical section: at most one thread can > execute Caml code at a given time, but arbitrarily many other threads > can be blocked on I/O (and thus isn't calling the Caml runtime system). > Each thread leaves the critical section before calling a potentially > blocking I/O operation, and re-enters it when the I/O completes. In the case i have a multi-threaded lablgtk executable, having ine thread managing the interface and the other running programs, that even if i had a way of killing a thread (or setting a mutex or whatever to signal it to stop), that if the running thread is looping, i will never be able to execute the interface thread which will (trough a callback) set the mutex to the stop option, because the running thread doesn't do blocking IO ? Mmm, checking the mutex is a blocking IO though, isn't it ? keeping the GUI alive even if some other stuff is taking time or looping forever is a nice application of threading support. Friendly, Sven Luther ------------------- 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