I know the basic difference between two of them that ConcurrentLinkedDeque can be use in multithreaded application.
Can any one give me practical example how it would affect the performance of application if wrongly used, in which scenario i should go with ConcurrentLinkedDeque and when to use ArrayDeque.
Use
ConcurrentLinkedDequeif you need synchronized access to your queue from multiple threads,ArrayDequeif not.Period.
The consequence of using the wrong one is that if you attempt to access an
ArrayDequein a multi-thread setting you will corrupt your queue.Period.
That is your only performance consideration. All others are moot.
Unless...
You ran your application through a profiler and discovered most of its time is spent inside of
ConcurrentLinkedDeque.size(). Then switch toArrayDequewrapped insynchronizedblocks.End of lecture ;)