Click here to Skip to main content
15,891,316 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Friends,

Some Queue (Dot net Queue (Collections))Items are skipped when multiple threads are running in parallay .Please Address this problem..
Posted
Comments
Suvendu Shekhar Giri 1-Jul-15 6:31am    
Not sufficient information.
CPallini 1-Jul-15 6:35am    
OK, solved.

1 solution

If you need thread safety, use ConcurrentQueue<T> - ConcurrentQueue[^]. The advantage with this queue is when multiple threads read or write data, locking is taken care of by the queue itself.

You could always implement locking in a normal queue.
 
Share this answer
 
v3
Comments
rkrajukokkula 1-Jul-15 8:07am    
Thank You...Abhinav...

But Problem is we are adding the items for separate queue objects for separate threads..Queue items are missing only some times...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900