[concurrency-interest] Concurrency-interest Digest, Vol 35, Issue 22

Sam Berlin sberlin at gmail.com
Tue Dec 18 13:39:10 EST 2007


Are changes to Java's built-in TPE mirrored (or first added to) the
public domain one at:
http://gee.cs.oswego.edu/cgi-bin/viewcvs.cgi/jsr166/src/main/java/util/concurrent/
?

Sam

On 12/18/07, Martin Buchholz <Martin.Buchholz at sun.com> wrote:
> Moran,
> This bug was fixed in 6.0 build 93,
> apparently by fix for:
>
> 6440728: ThreadPoolExecutor can fail to execute successfully submitted
> tasks as specified
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6440728
>
> Martin
>
> > Message: 2
> > Date: Tue, 18 Dec 2007 17:16:28 +0200
> > From: "Moran Avigdor" <moran at gigaspaces.com>
> > Subject: [concurrency-interest] ThreadPoolExecutor with corePoolSize
> >       as Zero
> > To: <concurrency-interest at cs.oswego.edu>
> > Message-ID:
> >       <3623E06481E65B45866CB3AF32C4FA87A325C1 at hercules.gspaces.com>
> > Content-Type: text/plain; charset="us-ascii"
> >
> > When initializing a thread pool with a core-pool-size of Zero I see that
> > no threads execute the runnable tasks.
> >
> > Looking at this further it seems that only if the queue rejected the
> > offer, then a first thread will be created.
> >
> >
> >
> > A ThreadPoolExecutor with a SynchronousQueue() will work - but a
> > LinkedBlockingQueue() will not.
> > Is this considered a known limitation? Must I initialize my pool with
> > corePoolSize as 1 with an unbounded queue?
> >
> >
> >
> > ThreadPoolExecutor pool = new ThreadPoolExecutor(0, 10, 60L,
> > TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>());
> >
> >
> >
> > for (int i=0; i<10; ++i)
> >
> > {
> >
> >       pool.execute(new Runnable() {
> >
> >             public void run() {
> >
> >                   System.out.println("running");
> >
> >             };
> >
> > });
> >
> > }
> >
> >
> >
> > Thanks.
> >
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at altair.cs.oswego.edu
> http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
>


More information about the Concurrency-interest mailing list