Re: libgc (a.k.a. Boehm's gc) on top of NGPT (Next Generation Posix Threads)

[email protected]
Newsgroups gmane.linux.ngpt.devel
Message-ID <[email protected]>
On 06/22/2002 at 10:39:08 PM ZE2, Marijn Ros <[email protected]>
wrote:
>
> [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.

Good enough for me!!!

>
> 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).

NGPT has just what you're looking for.  There are two np (non-POSIX) apis
that are just what is needed.  They are pthread_suspend_np and
pthread_resume_np.  libgc should be able to iterate over the running
threads and suspend and resume as needed.  A third np api can then be
called to retrieve the context (including the stack ptr) of the suspended
thread.  These apis are used by the IBM jvm currently being ported to take
advantage of NGPT and they are up to the job.

Regards,
     Bill Abt
     Senior Software Engineer
     Next Generation POSIX Threading for Linux
     IBM Cambridge, MA, USA 02142
     Ext: +(00)1 603-673-3440
     T/L: 253-9938
     Cell: +(00)1 617-803-7514
     [email protected] or [email protected]
     http://oss.software.ibm.com/developerworks/opensource/pthreads
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.