Utilities for multithread and async programming