caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "David Allsopp" <dra-news@metastack.com>
To: "'OCaml List'" <caml-list@yquem.inria.fr>
Subject: RE: [Caml-list] Win32 Services & O'Caml
Date: Thu, 25 Jan 2007 15:35:01 -0000	[thread overview]
Message-ID: <006201c74096$611078d0$6a7ba8c0@treble> (raw)
In-Reply-To: <1169736821.5807.19.camel@rosella.wigram>

I agree --- although, unless my understanding of how Win32 does it is
completely wrong, I don't think there are any non-O'Caml threads in use.
StartServiceCtrlDispatcher is invoked by an O'Caml created thread and it
doesn't return until the very end of the service (i.e. when the service has
been totally shutdown and the process is terminating).

However, what's not clear to me is whether there are implications of an
O'Caml function calling a C-function which calls back to another C-function
which subsequently calls back to O'Caml!!


David

-----Original Message-----
From: skaller [mailto:skaller@users.sourceforge.net] 
Sent: 25 January 2007 14:54
To: David Allsopp
Cc: OCaml List
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++: http://felix.sf.net


      reply	other threads:[~2007-01-25 15:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-25 11:53 David Allsopp
2007-01-25 14:53 ` [Caml-list] " skaller
2007-01-25 15:35   ` David Allsopp [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='006201c74096$611078d0$6a7ba8c0@treble' \
    --to=dra-news@metastack.com \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).