commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Scot Hale" <hal...@hotmail.com>
Subject Re: ThreadPool Contribution
Date Tue, 16 Mar 2004 17:40:49 GMT
Yoav,

Thanks for the pointers.  Can we add this comment to the xdocs/index.xml?
Something like

<p>

For a full-featured threading library  see Doug Lea's util.concurrent.

(works fine on early JDKs, and is now java.util.concurrent in JDK 1.5)

</p>


----- Original Message ----- 
From: "Shapira, Yoav" <Yoav.Shapira@mpi.com>
To: "Jakarta Commons Developers List" <commons-dev@jakarta.apache.org>
Sent: Tuesday, March 16, 2004 5:47 AM
Subject: RE: ThreadPool Contribution



Hi,
Thanks for the contribution ;)  AFAIK there's negligible usage of the
ThreadPool library, because Doug Lea's util.concurrent library (is free,
works fine on early JDKs, and is now java.util.concurrent in JDK 1.5) is
highly popular, reliable, and full-featured.

Yoav Shapira
Millennium Research Informatics


>-----Original Message-----
>From: Scot Hale [mailto:halesm@hotmail.com]
>Sent: Monday, March 15, 2004 6:44 PM
>To: commons-dev@jakarta.apache.org
>Subject: ThreadPool Contribution
>
>Hi,
>
>I have been using the Sandbox ThreadPool library, and have been finding
it
>quite useful.  I did make a change to the MTQueue.remove() though.  If
you
>are interested this is what I changed :
>
>============
>MTQueue.java
>from
>http://jakarta.apache.org/commons/sandbox/threadpool/xref/org/apache/co
mmon
>s/threadpool/MTQueue.html#113
>
>This way the MTQueue will just wait until something is added to the
queue,
>instead of looping every 10 seconds until something is added to the
queue.
>the MTQueue.add adequately notifies this Thread and returns null.
>============
>    /**
>     * Removes the first object from the queue.
>     * If the Queue is empty, it will wait() until another
>     * Runnable is added to the queue.
>     */
>    public synchronized Object remove(){
>        try{
>            return list.removeFirst();
>        }catch (NoSuchElementException e){
>            try {
>                wait();
>            }
>            catch (InterruptedException e1) {
>            }
>        }
>        return null;
>    }
>
>
>
>Scot Hale

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message