rajdey1 0 Newbie Poster

Hi

I am implementing a project in C# in which I have to use a Queue. Now this Queue will be accessed by three different threads let me call them thread "A","B" and "C" . Thread "A" and thread "B" will be alive through out the Applications life time and thread "A" will en-queue element in the Queue where as thread "B" will De-queue element from the queue.And thread "C" will be started only if user selects a certain task now this third thread will also en-queue element in the Queue but it will en-queue huge amount of element approximately 1000. I am confused how to handle this situation whether to use mutex or manualResetEvent or AutoResetEvent at the same time I want to Give equal Priority to Thread "A" And Thread "B" when thread "C" is not Alive But when thread "C" is Alive Thread "B" should get highest priority and thread "B" priority comes just below thread "A" priority and thread "C" will have minimum priority. Kindly Suggest How do I implement this situation.

You can also Give complete new way of implementing this situation even if your suggestion donot need Queue it doesnot matter to me I only need a proper way of implementing this situation.

Thanks In Advance