[kaffe] patch for unix-jthread hang

Guilhem Lavaux guilhem at kaffe.org
Fri Aug 6 00:06:09 PDT 2004

jrandom wrote:

>Hash: SHA1
>Hi y'all,
>Here's a small patch for a bug in unix-jthreads that i've been
>running into for a while.  Basically if there aren't any ready
>threads when reschedule() is called, control will enter handleIO(),
>which in turn will block on poll/select indefinitely until data
>is available.  The problem with this is that it doesn't take into
>account threads that are on the alarm queue - I saw this scenario
>occur when my JVM would hang for several minutes in handleIO, only
>to have a whole truckload of things fire up when I open a new socket.
>The OS I've tested this on uses poll, so I've only gone down the
>#if USE_POLL branch, but I modified the #else logic according to what
>I think should do the trick.  My C is /very/ rusty though, so please
>double check this :)
>muchas gracias,

Hi !

 Thank you very much for fixing that bug. All looks ok for me but for 
one line:
maxWait is is milliseconds and timeval.tv_usec is in microseconds.
So we must have (maxWait % 1000) * 1000 there.

>+               struct timeval maxWaitVal = { maxWait/1000, maxWait % 1000 };
>+               r = select(maxFd+1, &rd, &wr, 0, &maxWaitVal);
>+       }



More information about the kaffe mailing list