EventBarrier is like a drawbridge gate at a castle. Weary traveling minstrels arrive outside the gate of the castle for the drawbridge to come down. The gatekeeper lowers the bridge and calls raise on the gate to wake up the waiting minstrels. The minstrels respond to the event by crossing the drawbridge to enter the castle through the gate. After entering they invoke complete to inform the gatekeeper that they have crossed. When all minstrels have completed the EventBarrier reverts to the unsignaled state and the raise call returns: the gate is closed. EventBarrier enables this synchronization in a way that lets any number of minstrels enter the castle while the gate is open, and prevents the gatekeeper from closing the gate while minstrels are still crossing the bridge.
vishsram / drawbridge Goto Github PK
View Code? Open in Web Editor NEWEventBarrier is like a drawbridge gate at a castle. This project is implemented using multi-threading and semaphores concepts in C#.