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 KAA20957; Tue, 26 Nov 2002 10:34:10 +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 KAA21053 for ; Tue, 26 Nov 2002 10:34:10 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id gAQ9Y2X22576; Tue, 26 Nov 2002 10:34:02 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA21033; Tue, 26 Nov 2002 10:34:01 +0100 (MET) Date: Tue, 26 Nov 2002 10:34:01 +0100 From: Xavier Leroy To: Sven Luther Cc: Blair Zajac , caml-list@inria.fr Subject: Re: [Caml-list] Why systhreads? Message-ID: <20021126103401.A11423@pauillac.inria.fr> References: <20021123090806.GA633@la.iki.fi> <20021125110133.A12077@pauillac.inria.fr> <3DE2736D.F4FCC064@orcaware.com> <20021126100254.A19708@pauillac.inria.fr> <20021126092924.GA5383@iliana> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20021126092924.GA5383@iliana>; from luther@dpt-info.u-strasbg.fr on Tue, Nov 26, 2002 at 10:29:24AM +0100 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > 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 ? That's a long question. Had to read it three times to see what you mean :-) The answer to your question is that Caml systhreads do support preemption: a timer forces the currently running thread to call Thread.yield() at regular intervals. In turn, Thread.yield() releases the master mutex, calls sched_yield(), and re-acquires the master mutex, giving other threads a chance to grab the master mutex and run. > keeping the GUI alive even if some other stuff is taking time or looping > forever is a nice application of threading support. Sure. But this is all taken care of. - Xavier Leroy ------------------- 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