libgc (a.k.a. Boehm's gc) on top of NGPT (Next Generation Posix Threads)
Marijn Ros <[email protected]>
| Newsgroups | gmane.linux.ngpt.devel |
|---|---|
| Message-ID | <[email protected]> |
[This mail is sent to both Hans Boehm (the author of libgc) and
pthreads-devel (the NGPT development list)]
I hope my english is good anough to explain my ideas.
I want to try to port libgc to run on top of NGPT, because I would
like to be able to run mono on top of that combination.
Unfortunately, NGPT is not binary compatible anough with linuxthreads
for libgc to work. E.g., libgc uses signals to stop the world and at
the same time find the stack-pointer (on linux, that is), but NGPT
redirects signals to a different stack using sigaltstack.
As I understand it, all libgc needs is a way to suspend all 'other'
threads, get their stack-pointers (GC_stop_world) and finally let the
'other' threads continue again (GC_start_world).
As NGPT is a mixed native/user-space threading library (like
Solaris-threads?), suspending the threads is probably a two-stage
process:
1. suspend all other lwp's (native threads, perhaps using SIGSTOP)
2. suspend all other threads (which are now on our native thread
(pthread_suspend_np() should work), or already suspended if they
were bound to, or running on, another native thread)
Getting the stack-pointers will require access to the internal
structures of the pth_st struct. Do the registers need to be pushed on
the stack?
And then of course, continuing the threads is just the opposite of the
suspend function.
Is this doable? Or should I focus on something else until NGPT is
declared stable?
I am mostly programming high-level, so I might overlook some important
problems. Therefor, all comments are welcome.
Bye,
Marijn
PS: I am not subscribed to pthreads-devel, but read the archives
almost every day. This mail-address is usually read twice or thrice a
week, so don't be surprised if I don't reply immidiately.