Deterministic execution of multithreaded applications for reliability of multicore systems