I have WorkerThreadone that does the job on the items in the queue and a few MiningThreadthat create the stuff that needs to be done with WorkerThread.
To summarize: one stream of Dequeues and several Enqueue.
Do I need to use the synchronization pattern suggested in msdn, or am I sure of the flow in this particular scenario?
From msdn a simple template with synchronization
Queue myCollection = new Queue();
lock(myCollection.SyncRoot)
{
foreach (object item in myCollection)
{
}
}
source
share