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 VAA03190; Wed, 3 Apr 2002 21:52:56 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id VAA02825 for caml-list@pauillac.inria.fr; Wed, 3 Apr 2002 21:52:55 +0200 (MET DST) 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 TAA24597 for ; Wed, 3 Apr 2002 19:22:09 +0200 (MET DST) Received: from localhost.home.net ([217.164.67.152]) by nez-perce.inria.fr (8.11.1/8.11.1) with SMTP id g33HM7D20556 for ; Wed, 3 Apr 2002 19:22:07 +0200 (MET DST) Received: (qmail 3501 invoked by uid 1000); 3 Apr 2002 17:20:25 -0000 From: ronniec95@lineone.net Date: Wed, 3 Apr 2002 21:20:25 +0400 To: Olivier Andrieu , caml-list@inria.fr Subject: Re: [Caml-list] Interfacing C threads with Ocaml - weird bug Message-ID: <20020403172025.GA3487@cradle.net.ae> References: <20020402080216.GA845@cradle.net.ae> <15531.9799.220007.210452@akasha.ijm.jussieu.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <15531.9799.220007.210452@akasha.ijm.jussieu.fr> User-Agent: Mutt/1.3.27i Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Wednesday 03 April 2002 at 16:43PM, Olivier Andrieu attributed that: > ronniec95@lineone.net [Tuesday 2 April 2002] : > > > > Hi guys, > > > > I've written a Ocaml interface for an C-API. It sets up some parameters > > (all works) then starts a thread pool (C). I then call a mainloop > > function that contains a while loop that, upon receiving a request > > dispatches the event to a C callback. > > > > OCAML: > > let receiver () = > > let _ = Tib.opent () > > and tport = Tib.create_transport "" "" "" > > and queue = Tib.default_queue () in > > (...) > > > Any ideas (very) helpful. > > Hi, maybe you've solved your problem already but I have a comment on > your code : > you use ? let _ = ... and tport = ... and queue = ... ?. Now I'm not > sure in which order the evaluation takes place in case of ? let > ... and ... ? construct : actually the manual says it's > "unspecified". Since Tib.opent should be evaluated before everything > else I guess, I'd say it's better to use ? let _ = Tib.opent () in let > tport = ... ?. Hmm - it appears to work with either construct, but as you say, it's obviously incorrect to rely on this. I had assumed that the only reason you have to use 'in' is when you will be using the result of a previous calculation. So I've also fixed this (potential) bug. > > But your threads problem is probably unrelated to this. > Using classic divide and conquer I managed to track down the thread bug to an incorrect Field(x,y) macro earlier in the initialisation. Thanks for all the help Regards Ronnie > -- > Olivier -- ->=======================================<- name: ronnie m chowdhury mobile:+971-50-566-4437 tel: +971-2-681-7600 fax: +971-2-681-7900 addr: 1304, three sails towers corniche road west abu dhabi po box 41876, united arab emirates ->=======================================<- ------------------- 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