I have a console application that generates a thread that serves as a WCF services. I also have other threads in the application. I syncronize the incoming data to the WCF service via a Queue class the uses "EventWaitHandle"s. For some reason the WCF thread is not correctly doing a "Set" on the EventWaitHandle. Running the Queue class by itself (no WCF) works fine and has worked successfully in many different multi-threaded environments. The queue class is tread safe implementation of a multiple reader - multiple writer queue. The problem seems to be associated with not have the correct context for EventWaitHandle when being Set on the WCF thread. In the intended environment there may be several identical applications running each with a unique binding but servicing multiple clients. I have played around with
[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.....)] but it does not seem to help. Any clues as to a direction to follow?