I would like to introduce an interesting (hopefully) application of
libpfm4 called DPTHREAD.
DPTHREAD is a threading library which you can link to your multithread
applications written in C using pthread APIs. it make multi thread
programs behave deterministically by enforcing the order of thread
execution based on instruction count of each thread during the
execution. It supports both multicore and single core systems.
Please check out the following website if you are interested.