Fast resizable semaphore implementation based on CAS (faster than channel-based semaphore implementations).