[Gc] Darwin mach threads vs pthreads
Stephane.Epardaud at sophia.inria.fr
Mon Jun 27 05:55:17 PDT 2005
While porting Lurc to MacOSX, I'm currently compiling the GC 7.0a3 on MacOSX and
I have questions regarding darwin_stop_world. I compile with
--enable-threads=pthreads and that gets me pthread_support.c, but it also
defines GC_DARWIN_THREADS, which gets me darwin_stop_world instead of
pthread_stop_world. Why is that ?
In pthread_support, the GC manages the list of threads itself, and even has a
mapping of pthread->mach-thread, whereas darwin_stop_world doesn't use anything
pthread. Besides, the way I see it, pthread_stop_world would also work for
MacOSX, since everything in there is pthread.
I don't understand the need to delve into mach threads if pthreads are supported
on the platform. What is the reason for that (I'm sure there must be a good one,
but I haven't figured it out) ?
Which leads me to the next question, why have a mapping of pthread->mach-thread
in pthread_support.c, I cannot see where it is used ?
It seems to me the darwin_stop_world works for both mach-threads and pthreads on
MacOSX, whereas pthread_stop_world only for pthreads, but then what use is there
to the whole pthread_support functions for wrapping pthreads (maybe they aren't
even wrapped on darwin?) ?
Sorry for all these questions, but really I'm confused as to how to integrate
Lurc on MacOSX....
Thanks for the help.
More information about the Gc