Multithreaded item-processing queue I have this Queue declared in my class:

static private Queue&lt;SignerDocument&gt; QUEUE = new Queue&lt;SignerDocument&gt;(); 


I fill this Queue with some items to process, and I want to process it using multithreading.

Did I need to use lock in this case, to ensure that QUEUE.Dequeue is thread-safe?

static protected void ThreadProcManager()
{     
   lock (typeof(Queue&lt;SignerDocument&gt;))
   {
       if (QUEUE.Count &gt; 0)
       {
           ThreadPool.QueueUserWorkItem(ThreadProc, QUEUE.Dequeue());
        }
    }
}

 static private void ThreadProc(Object stateInfo)
 {
     //Do the work...
 }
Yes, and don't lock on typeof - highly unrecommended. Also you'll need to lock whatever's adding to the QUEUE so that the multithreaded Dequeue() does not race against it.

static protected void ThreadProcManager()
{     
   lock (QUEUE)
   {
       if (QUEUE.Count &gt; 0)
       {
           ThreadPool.QueueUserWorkItem(ThreadProc, QUEUE.Dequeue());
        }
    }
}

 static private void ThreadProc(Object stateInfo)
 {
     //Do the work...
 }