Hi everyone !
I am running a application with a LOT of thread. All these threads are updating database with GPS coordinates. Meanwhile, the application can receive a synchronization request. Before the server can process this request, all the writing threads have to finish their job. Therefore I am using an array of wait handles to manage this.
So here is the scenario:
The actors:
1 Synchro Thread
N Writing Thread
N Writing threads are working. One Synchro thread arrives at the wait handles stop. It claims for the lock. Doing so, it is put at the end of the list of "claiming lock threads".
Problem is: this list could be very long, or my synchro thread is top priority.
How could I achieve to give it a VIP pass ?