Bulk put/take queue operations

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

Bulk put/take queue operations

Jean Morissette
Hi,
    Is there any plan to support bulk put/take queue operations?  This
would be usefull to improve performance by reducing lock overhead.  
Also, this could add a kind of optimistic transactionnal semantic (if
the queue is bounded), which the current API doesn't support.

Regards,
Jean
_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
Reply | Threaded
Open this post in threaded view
|

Re: Bulk put/take queue operations

Doug Lea
Jean Morissette wrote:
> Hi,
>    Is there any plan to support bulk put/take queue operations?  


For bulk-removes, there's BlockingQueue,drainTo. For bulk-adds,
there's addAll, although this is useful only for unbounded queues.
(For bounded ones, it will throw an exception if some cannot be
added without blocking.) Do you have something further in mind?

-Doug


_______________________________________________
Concurrency-interest mailing list
[hidden email]
http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest