libgcj/1420: Linux GC causes premature thread wakeup

mdw@cs.berkeley.edu mdw@cs.berkeley.edu
Wed Dec 20 12:26:00 GMT 2000


>Number:         1420
>Category:       libgcj
>Synopsis:       Linux GC causes premature thread wakeup
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    tromey
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Dec 20 12:19:41 PST 2000
>Closed-Date:    Fri Sep 10 14:25:40 PDT 1999
>Last-Modified:  Fri Sep 10 14:25:40 PDT 1999
>Originator:     Matt Welsh
>Release:        2.95.1
>Organization:
>Environment:
x86 Linux, Red Hat 6.0, gcc 2.95.1
>Description:
Thread.sleep() often does not sleep often enough. It seems
this is due to the garbage collector running, which resumes
the thread prematurely when GC_start_world is called. 
Essentially bohem-gc/linux_threads.c has no knowledge of
threads which are already sleeping on some condition, so 
it is possible that this may cause other strange thread
scheduling problems as well. 

I am currently working on the fix to this problem, but am
submitting the PR so we can track it. Please let me know
before submitting any fix!
>How-To-Repeat:
Create two threads. One spins in a loop and repeatedly calls
Thread.sleep() with some large value (say 10000). The other
thread repeatedly creates new objects and forgets about them.
You will see the sleeping thread does not sleep long enough
during each iteration.
>Fix:
Modify bohem-gc/linux_threads.c to be aware of resuming
threads which were already sleeping on some condition.
>Release-Note:

>Audit-Trail:

Formerly PR libgcj/42

State-Changed-From-To: open->closed
State-Changed-By: tromey
State-Changed-When: Fri Sep 10 14:25:40 1999
State-Changed-Why:
    Matt sent a patch for this, which I checked in.
>Unformatted:




More information about the Gcc-prs mailing list