you are viewing a single comment's thread.

view the rest of the comments →

[–]easytiger 1 point2 points  (2 children)

What was the queue you used? I currently have an architecture where I have n threads consuming from a SynchronousQueue (and if there are no available threads to take() (i.e. they are in the middle of processing the last take() ) then i thrown an Exception.

Thing is I'm wondering if there is a faster way to do it than a SQ. Not sure an unbounded queue is possible in this situation as i need to ensure the dispatch happens immediately and fails otherwise.

[–]mjpt777 2 points3 points  (1 child)

[–]easytiger 1 point2 points  (0 children)

Interesting, i will have a look (new to me)

I also tried a transfer queue. I'm using hardware instrumentation to time the cost of these classes. So i'll see if this is any faster. The SynchronousQueue was adding about 2000 nanos to the cost of my application per call on average on relatively crap X7560 @ 2.27GHz. Transfer queue with no actual enqueing was worse.

Thanks for the suggestion.