Concurrent Programming: Algorithms Principles and Foundations