hello friends please see the code below..Here I am using executors for multi-threading....
My problem is that I am acquiring lock on the list so that in consumer
thread only one thread should be allowed to remove the element from list...but it has a drawback I cannot add an item in same list in producer as it might happen that list lock in taken by one of the consumer thread...
so I want that producer should be able to add in the list but only one consumer should be able to remove from it.. any suggestions...please note that there are 3 consumer threads and 1 producer thread
[Added code tags - see UseCodeTags for details]