pevents project alternative which also includes threads and critical sections