question on FiniteQueue bug in progress in CVS since v3.0

Quartz <[email protected]> Wed, 10 Sep 2003 07:07:37 -0700 (PDT)
Newsgroups gmane.comp.java.seda.user
Message-ID <[email protected]>
Hi,

I see that FiniteQueue.enqueue() had a bug being tracked at the moment of v3.0.

This code:

      // XXX MDW: Trying to track down a bug here ...
      if (DEBUG) System.err.println("**** ENQUEUE ("+name+") **** Doing notify");
      blocker.notify();
      if (DEBUG) System.err.println("**** ENQUEUE ("+name+") **** Done with notify");
      //blocker.notifyAll();


was replaced by this code.

      if (DEBUG) System.err.println("**** ENQUEUE ("+name+") **** Doing notify");
      blocker.notifyAll();
    }
    if(threadmgr!=null)
      threadmgr.wake();


What was the bug, excactly?

I have some doubt about using notifyAll() instead of notify, enqueue does not need to wake up all
threads, in all queue implementation I have ever seen. The real fix stands in calling notify() in
all dequeue, I think, as I explained in a previous unanswered message in this forum and on the bug
list. Thanks for answering this time. This has serious performance implications, where waked up
threads would wake up and loop for no reason, causing large amount of context switching.


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf