When a pool is blocked ?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

When a pool is blocked ?

Serkan Demir
Hi guys,
In javadocs it is written that "If the maximum pool size or queue size
is bounded, then it is possible for incoming execute requests to
block."
In our application, we have set PooledExecutor's abortWhenBlocked()
method and want Runtime exceptions when the queue is full. Although
our queue is full and our threads cannot serve new jobs, i cannot get
this Runtime exception. What is the policy for this blocking and when
a pool is blocked?



--
-----------------------------------------------
Serkan
blog: serkandemir.blogspot.com
web: www.serkandemir.com
_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

Re: When a pool is blocked ?

alarmnummer
Did you use the java.util.concurrent.ThreadPoolExecutor?

If you use that Executor implementation, you can set the
RejectedExecutionHandler. One of the implementation is one that abort:
ThreadPoolExecutor.AbortPolicy and it throws a
RejectedExecutionException when the queue if full and a new task is
added.

Does this answer your question?

On 8/29/06, Serkan Demir <[hidden email]> wrote:

> Hi guys,
> In javadocs it is written that "If the maximum pool size or queue size
> is bounded, then it is possible for incoming execute requests to
> block."
> In our application, we have set PooledExecutor's abortWhenBlocked()
> method and want Runtime exceptions when the queue is full. Although
> our queue is full and our threads cannot serve new jobs, i cannot get
> this Runtime exception. What is the policy for this blocking and when
> a pool is blocked?
>
>
>
> --
> -----------------------------------------------
> Serkan
> blog: serkandemir.blogspot.com
> web: www.serkandemir.com
> _______________________________________________
> Concurrency-interest mailing list
> [hidden email]
> http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
>
_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

Re: When a pool is blocked ?

alarmnummer
I haven't used the old version of the concurrency library. You know
there is a backport from the concurrency library for java 1.4 ?

http://dcl.mathcs.emory.edu/util/backport-util-concurrent/

On 8/29/06, Serkan Demir <[hidden email]> wrote:

> sorry i forgot to say which release i used. it is concurrent-1.3.4
> (oswego jar). I have already set abortWhenBlocked() and waiting for
> Runtime exceptions whenever queue is full.
> Is exception thrown when both the queue is full and all threads are
> unavailable or either queue is full or threads in the pool are
> unavailable?
>
>
>
> On 8/29/06, Peter Veentjer <[hidden email]> wrote:
> > Did you use the java.util.concurrent.ThreadPoolExecutor?
> >
> > If you use that Executor implementation, you can set the
> > RejectedExecutionHandler. One of the implementation is one that abort:
> > ThreadPoolExecutor.AbortPolicy and it throws a
> > RejectedExecutionException when the queue if full and a new task is
> > added.
> >
> > Does this answer your question?
> >
> > On 8/29/06, Serkan Demir <[hidden email]> wrote:
> > > Hi guys,
> > > In javadocs it is written that "If the maximum pool size or queue size
> > > is bounded, then it is possible for incoming execute requests to
> > > block."
> > > In our application, we have set PooledExecutor's abortWhenBlocked()
> > > method and want Runtime exceptions when the queue is full. Although
> > > our queue is full and our threads cannot serve new jobs, i cannot get
> > > this Runtime exception. What is the policy for this blocking and when
> > > a pool is blocked?
> > >
> > >
> > >
> > > --
> > > -----------------------------------------------
> > > Serkan
> > > blog: serkandemir.blogspot.com
> > > web: www.serkandemir.com
> > > _______________________________________________
> > > Concurrency-interest mailing list
> > > [hidden email]
> > > http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
> > >
> >
>
>
> --
> -----------------------------------------------
> Serkan
> blog: serkandemir.blogspot.com
> web: www.serkandemir.com
>
_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest