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
[Caml-list] SysThreads and Win/NT DLL's
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David McClain <barabh@q...>
Subject: [Caml-list] SysThreads and Win/NT DLL's
Well, I see now that it takes more than just one Lazy.force on the proposed
lazy init clause. In fact, any of the Thread routines that can accept a
non-Thread.t argument potentially needs the same Lazy.force inserted.

...but still, this isn't too bad...

Alas, any program statements that call upon these Thread routines at the top
level, e.g., non-closures with Thread calls for value, need to be delayed as
well, so that the DLL can successfully start up without spawning new
threads -- a no, no, in DllMain.

Of course the other possibility is to avoid calling caml_startup()
altogether from inside of DllMain, and instead handle deferred
initialization in other DLL entry points. That avoids the problem entirely,
but forces less automatic behavior on the user of the DLL.

- D.McClain, Sr. Scientist, Raytheon Systems Co., Tucson, AZ
Bug reports:  FAQ:
To unsubscribe, mail  Archives: