[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: MzScheme in a multi-threading environment
Quoting Blake McBride:
> After considerable effort and time we discovered that if MzScheme is called
> by an application and Win32 Threads is used the application must call
> DllMain in order to initialize the system for multi thread use. Now that we
> call that first the system seems to work fine. This leads me to some
> questions.
>
> 1. Are we doing it correctly now? Is there anything else we should be doing?
>
> 2. Is this documented somewhere?
Instead of calling DllMain, does it work to set
GC_use_registered_statics = 1
and then register any static variables that contain Scheme pointers?
I assume that you're using MzScheme in a single-threaded way, and that
MzScheme threads needn't be implemented as Windows threads.
There's a little bit of documentation about mixing MzScheme with
OS-implemented threads in "Inside MzScheme":
http://www.cs.rice.edu/CS/PLT/packages/doc/insidemz/node7.htm
Unfortunately, I see that the above page doesn't refer to the previous
one, which ends with an important note about threads and Windows:
http://www.cs.rice.edu/CS/PLT/packages/doc/insidemz/node6.htm
(I've fixed the duplicated sentence fragment on that page.)
Matthew