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

Cedric Berger cedric@wireless-networks.com
Sun Jan 20 20:00:00 GMT 2002

Adam Megacz wrote:

>Tom Tromey <tromey@redhat.com> writes:
>>Adam> Interesting. If it was cooperatively multitasked, did you have
>>Adam> to hack GCC to insert a yield() after every instruction?
>>No.  Java doesn't require preemptive multithreading (and even if it
>>did, at the time we didn't care).  We task switched on mutex and
>>condition variable operations, and maybe a couple other places.
>Woah, so what happens if I spawn two threads and put one of them into
>an infinite loop? Would the other one get starved?
In theory, Yes.
The programmer has to insert yield() calls from time to time in such 
java code.

More information about the Java mailing list