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 SAA23502; Fri, 19 Apr 2002 18:09:57 +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 SAA23651 for ; Fri, 19 Apr 2002 18:09:56 +0200 (MET DST) Received: from sunny.pacific.net.au (sunny.pacific.net.au [203.25.148.40]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id g3JG9rL25149; Fri, 19 Apr 2002 18:09:53 +0200 (MET DST) Received: from wisma.pacific.net.au (wisma.pacific.net.au [210.23.129.72]) by sunny.pacific.net.au with ESMTP id g3JG9pXt006875; Sat, 20 Apr 2002 02:09:51 +1000 (EST) Received: from ozemail.com.au (ppp227.dyn146.pacific.net.au [210.23.146.227]) by wisma.pacific.net.au with ESMTP id CAA26385; Sat, 20 Apr 2002 02:09:49 +1000 (EST) Message-ID: <3CC0414D.8030800@ozemail.com.au> Date: Sat, 20 Apr 2002 02:09:49 +1000 From: John Max Skaller User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2.1) Gecko/20010901 X-Accept-Language: en-us MIME-Version: 1.0 To: Xavier Leroy CC: Noel Welsh , caml-list@inria.fr Subject: Re: [Caml-list] Using threads in compiled code References: <20020418074543.95391.qmail@web11204.mail.yahoo.com> <20020419094208.C11763@pauillac.inria.fr> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk If you're using threads with sockets, you might want to do what I did: I took the library routine that launches a process on a connect [establish_server .. seems to be defunct now ..] and replaced enough code to make it launch a thread instead. I used the John Reppy style channels from the Threads library Event module for communication. My application was designed to provide an simulation of a telephone system. Getting the logic and timing right was very tricky -- coding it in Ocaml was very easy, those Reppy channel things are magic. The hardest part was managing termination .. [I'd never written a serious multithreaded app before .. Stevens + Ocaml makes a fine team :-] BTW: if you're looking at mobile agents .. JoCaml is worth examining... in fact, its worth examining even if you're not :-) -- John Max Skaller, mailto:skaller@ozemail.com.au snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia. voice:61-2-9660-0850 ------------------- 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