Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Win32 Services & O'Caml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-01-25 (14:58)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Win32 Services & O'Caml
On Thu, 2007-01-25 at 11:53 +0000, David Allsopp wrote:
> Yesterday I completed a module that allows construction of Win32 Services in
> O'Caml. Non-threaded O'Caml apps seem to be working just fine but I've hit a
> brick wall with multi-threaded applications.

I'm sure Xavier will fix my misconceptions here, but I suspect
the requirement is that Ocaml threading library must start the
threads so it can arrange for state to be properly shared,
in particular the heap. If other code starts the thread,
when it makes a callback into Ocaml, Ocaml can't find
the shared state because it was never established.

Any system (not just Ocaml) is going to have this problem
if it uses an environment not strictly conforming to that
provided natively. EG .. how do you share a young heap
pointer held in an AMD64 machine register across threads ..
when the OS carefully makes sure registers are not shared?? :)

John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: