Synchronization mechanisms for concurrent programming