[concurrency-interest] Too late to add a pushBack method to B lockingQueue?

Shaffer, Darron Darron_Shaffer@stercomm.com
Mon, 8 Sep 2003 13:31:20 -0500


I'm currently using a LinkedQueue in a mode where I could use a pushback.
In my code it's only one object at a time, so I was able to restructure the
code.  It does a peek() and, if the decision is made to "consume" the
retrieved object, a take().

A pushback would make the code structure cleaner, but I wonder if it would
cost more in synchronization?

Darron Shaffer

> -----Original Message-----
> From: David Walend [mailto:david@walend.net]
> Sent: Monday, September 08, 2003 12:58 PM
> To: concurrency-interest@altair.cs.oswego.edu
> Subject: [concurrency-interest] Too late to add a pushBack method to
> BlockingQueue?
> 
> 
> A friend of mine is trying to add message acknowledgment to Somnifugi 
> JMS. I'm trying to make some long-range plans to use 
> java.util.concurrent.BlockingQueues, and I think I need a method that 
> isn't there.
> 
> JMS acknowledge is a little strange. Under CLIENT_ACKNOWLEDGE, a JMS 
> client can keep taking messages without acknowledging any of them 
> immediately. Normally the client will acknowledge one of the messages 
> before a time out. If the client doesn't acknowledge in time, 
> then the 
> JMS Session has to redeliver all of the unacknowledged 
> messages in the 
> correct order. To keep the order correct, we need to be able 
> to push a 
> message back onto the head of the queue.
> 
> My friend is about to hack Professor Lea's LinkedNodes to get the 
> pushBack method we need. When jskd 1.5 comes out, I'd like to upgrade 
> from hacked Channel API to not-hacked BlockingQueue API.
> 
> Is it too late to plead a case for a pushBack method? Does 
> anyone else 
> need this?
> 
> Thanks,
> 
> Dave
> 
> -- 
> David Walend
> david@walend.net
> http://www.walend.net
> 
> 
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest@altair.cs.oswego.edu
> http://altair.cs.oswego.edu/mailman/listinfo/concurrency-interest
>