Skip to content

Latest commit

 

History

History
6 lines (4 loc) · 456 Bytes

README.md

File metadata and controls

6 lines (4 loc) · 456 Bytes

This is simple implementation of latch. When you need to skip some calculation for sumultaneous threads running at the same time and peforming the same calculation (for instance calculate the same Fibonacci number 13) you may rely on this code to make the calculation be performed in ONLY single thread.

As soon as calculation is ready, all waiting threads will be provided with same result.

You may significantly decrease CPU load by using this latch.