avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: event queue improvment
Date Mon, 25 Feb 2002 13:17:08 GMT
Emperor wrote:
> hi,
> 
> I had a look at the event queue implementation and I think a method that
> blocks until n elements can be enqueued could be very useful. 
> 
> For example, you could have a full queue of requests and an interceptor
> that adds requests to the queue. Using the block method, the interceptor
> would stop intercepting request when the queue is full, which would be
> the logical behavior of an overloaded system.


Queue is an interface.  If you want an implementation that takes care of
this semantic, more power to you.  I don't think it should be *Yet
another method*.

In a complex event routing system, you really don't want blocking at
all.  The reason is that depending on your thread manager, you may have
fewer threads than Queues.  In such a case it is more efficient to use
those finite amount of threads to pull the events in a non-blocking
manner.  If there are no events, move on to the next queue.



-- 

"They that give up essential liberty to obtain a little temporary safety
  deserve neither liberty nor safety."
                 - Benjamin Franklin


--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message