I have the following scenario: You can create three types of threads in the program, imagine that they are A, B and C. I have to respect the following rule:
A C thread can not access the critical region if there are already one or more B threads running and vice versa . (Threads A can run regardless of how many or which ones are also running)
My question is: What is the most efficient way to implement it in C #?