why I was seeing exceptions thrown across threads -- a detailed explanation

Tom Tromey tromey@redhat.com
Thu Jan 17 08:35:00 GMT 2002


>>>>> "Adam" == Adam Megacz <gcj@lists.megacz.com> writes:

Adam> I've been toying with the idea of doing stuff like this for
Adam> threads (assuming you can arrange for the OS can send you a
Adam> signal or interrupt every n milliseconds, which should be
Adam> possible even on DOS or PalmOS). The neat part about this is it
Adam> gets you "up and running" with a new port very quickly, and then
Adam> your only concern is improving performance by coding
Adam> replacements for the fallback implementations.

When I first wrote the thread code for libgcj, I used (a modified
version of) quickthreads, a cooperative thread package based on setjmp
(plus some small assembly hacks).  This was more convenient for
debugging, because I didn't need a thread-aware debugger; in fact, I
could examine the state of the thread system itself very easily.  This
code was never made public though, partly because we never finished
it.  For instance, with our quickthreads code, I/O always blocked all
the threads.

So, this is possible.  It is probably only really useful in unusual
circumstances though.

Tom



More information about the Java mailing list