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 QAA30289; Thu, 21 Aug 2003 16:50:36 +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 QAA24276 for ; Thu, 21 Aug 2003 16:50:35 +0200 (MET DST) 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 h7LEo2f18286; Thu, 21 Aug 2003 16:50:02 +0200 (MET DST) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id QAA23952; Thu, 21 Aug 2003 16:50:01 +0200 (MET DST) Date: Thu, 21 Aug 2003 16:50:01 +0200 From: Xavier Leroy To: Richard Jones Cc: Mikkel Fahn?e J?rgensen , caml-list@inria.fr Subject: Re: [Caml-list] Re: mod_ocaml 0.6.0 feedback Message-ID: <20030821165001.B14140@pauillac.inria.fr> References: <004d01c3664c$0e33a880$738c0a0a@spss.com> <20030819131556.GB5227@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: <20030819131556.GB5227@redhat.com>; from rich@annexia.org on Tue, Aug 19, 2003 at 02:15:56PM +0100 X-Loop: caml-list@inria.fr X-Spam: no; 0.00; caml-list:01 threading:01 posix:01 threads:01 callback:01 serialized:01 callbacks:01 dynlink:01 unload:01 unloading:01 ocaml:01 caml:01 modules:02 address:96 heap:03 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > The reason for not supporting Apache 2 is simply that I don't know > much about how to port Apache 1.x code to Apache 2. Also I'm a bit > worried about threading issues. (I've CC'd this to the caml-list - > can anyone comment?) I'm assuming Apache 2.0 is multithreaded, so that the Caml functions could possibly end up being called by several (POSIX) threads simultaneously. The following should work: - Put a mutex around calls to the "callback*" functions (those that call back into Caml from C), so that Caml execution is entirely serialized. - Do *not* use Caml threads in your Caml code, and do not link the Caml code with the Caml threading libraries. Currently, Caml threads and callbacks don't work together. I'll have to address this at some point in the future. > Unfortunately Dynlink doesn't provide a way to unload modules (can > anyone on caml-list comment?). This is correct, but there are no easy ways to do that. Unloading *safely* a piece of dynamically-linked code would require scanning the whole heap, making sure that no live function value refers to that piece of code. The alternative would be to let the GC find out the dead pieces of code, but again this is problematic since code blocks are not garbage-collected in the current implementation. - 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