This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: gcj crashes if a user-thread gives up its rights
- From: Bryce McKinlay <mckinlay at redhat dot com>
- To: Jost Boekemeier <jost2345 at yahoo dot de>
- Cc: Cedric Berger <cedric at berger dot to>, java at gcc dot gnu dot org
- Date: Mon, 13 Dec 2004 12:17:18 -0500
- Subject: Re: gcj crashes if a user-thread gives up its rights
- References: <20041213140720.49220.qmail@web60106.mail.yahoo.com>
Jost Boekemeier wrote:
That aside, the garbage collector may currently run
in any thread that allocates from the Java heap.
That makes sense. An old version of the IBM JDK
(1.4.1) has had the same problem. Since 1.4.2_02 and
the recent Sun JDK's this problem doesn't appear
anymore.
It would be interesting to know how these other VMs solved the issue.
Perhaps they only run the GC from one thread, which always has the
appropriate privileges?
Since gcj already catches the error, it should be easy
to use a different IPC mechanism when pthread_kill
fails, I guess a patch would consist of no more than a
few lines. I check this, if I have some time.
Is there is another IPC mechanism with the necessary semantics - ie able
to suspend any thread at any time, asynchronously? Also, note that there
are at least 2 other places in libgcj, besides GC, where signals are
used for IPC: java.lang.Process and Thread.interrupt().
Regards
Bryce