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 RAA20538; Wed, 4 Sep 2002 17:12:38 +0200 (MET DST) 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 RAA20690 for ; Wed, 4 Sep 2002 17:12:37 +0200 (MET DST) 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 g84FCa119305 for ; Wed, 4 Sep 2002 17:12:36 +0200 (MET DST) Received: from mel-rta9.wanadoo.fr (193.252.19.69) by mel-rto4.wanadoo.fr (6.5.007) id 3D760D080001748A; Wed, 4 Sep 2002 17:12:05 +0200 Received: from iliana (80.9.104.139) by mel-rta9.wanadoo.fr (6.5.007) id 3D760AD8000154C8; Wed, 4 Sep 2002 17:12:05 +0200 Received: from luther by iliana with local (Exim 3.35 #1 (Debian)) id 17mbNc-0000NA-00; Wed, 04 Sep 2002 16:43:40 +0200 Date: Wed, 4 Sep 2002 16:43:30 +0200 To: Lauri Alanko Cc: caml-list@inria.fr Subject: Re: [Caml-list] Inter-thread exceptions Message-ID: <20020904144330.GB1186@iliana> References: <20020903164851.A26567@kruuna.Helsinki.FI> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020903164851.A26567@kruuna.Helsinki.FI> User-Agent: Mutt/1.4i From: Sven LUTHER Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, Sep 03, 2002 at 04:48:51PM +0300, Lauri Alanko wrote: > Hello. > > How big a task would it be to implement asynchronous inter-thread > exceptions? In practice the feature would amount to a function: > > val raise_to : exn -> Thread.t -> unit > > This would be most handy for implementing eg. timeouts: just make a thread > that sleeps and raises an exception in the other thread when the time is > spent. > > The GHC folks and John Reppy have done some work on spelling out the > semantics of asynchronous exceptions in Haskell. Could this be used as a > base for a similar system in a strict and impure setting like ocaml? What > would be the main difficulties, both theoretically and implementation-wise? BTW, also it would be nice to have a (working) way to kill a thread. There is kill, but it does not seem to be implemented. Well, what i really want to do is to have a thread running a GUI, and have some events which will launch another thread doing some calculation, which may take a long time (or even tnot finish). So i thought having a button or something in the GUI handled by the main thread to kill the launched thread would come in handy, saddly, the kill function is not implemented. 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