Structured concurrent programming with operating systems applications