This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
RE: timetable change on mingw-libgcj
- From: "Boehm, Hans" <hans_boehm at hp dot com>
- To: "'Adam Megacz'" <gcj at lists dot megacz dot com>, java at gcc dot gnu dot org
- Date: Mon, 17 Dec 2001 16:18:56 -0800
- Subject: RE: timetable change on mingw-libgcj
I agree that's not good.
How are MacOSX threads implemented? Do they map directly to kernel threads?
Is there a way to stop a thread other than by sending it a signal?
Pthread_kill seems to be used by _Jv_ThreadInterrupt and the GC. Last I
checked, Thread.interrupt() seemed broken in enough VMs that you might get
away without if for a while.
The collector needs pthread_kill to stop all non-GC threads during a GC. If
there's an alternate way to suspend threads, that might work, though it's
ugly. (Solaris_threads.c uses this approach, though it's complicated there
by the fact that it actually suspends lwps, i.e. kernel-level threads.) You
need to able to stop threads in such a way that:
a) You can wait for them to actually stop. (Just sending a signal without
waiting for an acknowledgement from the handler is probably not sufficient.)
b) You can somehow get at enough of each thread's state that the collector
can find pointers in registers and on the stack. The Solaris implementation
relies on the fact that you can fairly easily find dirty stack pages,
something that's probably not true for most other operating systems. This
is needed since there is no easy way to retrieve the stack pointer values.
If someone has connections at Apple, it might be worth asking what they do
in their JVM to stop threads for the collector. Unfortunately, they may
compile in code so that threads can voluntarily stop when requested. This
is a bit problematic if a gcj thread is in a long running compute-intensive
piece of CNI code.
Hans
> -----Original Message-----
> From: Adam Megacz [mailto:gcj@lists.megacz.com]
> Sent: Monday, December 17, 2001 3:12 PM
> To: java@gcc.gnu.org
> Subject: Re: timetable change on mingw-libgcj
>
>
>
> Adam Megacz <gcj@lists.megacz.com> writes:
> > > boehm-gc will need some porting to work with darwin's threads,
> > > because they don't have pthread_kill implemented.
>
> > Ugh, that's not good. Not good....
>
> Actually, I was reading the boehm-gc docs, and it appears that
> boehm-gc needs a few extensions to pthreads, which are implemented
> differently on different platforms.
>
> Is there another platform that implements the same set (or a subset)
> of pthreads extension functionality as MacOSX? That way I could simply
> copy over that part of the configure.in switch case to get myself up
> and running quickly.
>
> - a
>