How to protect critical sections of processes executing in different cores?

62 views Asked by At

I have assigned the processes I create to different cores by using sched_setaffinity() and created mutex as process shared:

pthread_mutexattr_setpshared(&psharedm,PTHREAD_PROCESS_SHARED);

This mutex is stored in a file location accessed by all the processes. It works fine for processes in the same core but the processes in different cores are executing as if there are no critical sections. They are executing in parallel like a normal case. So basically, How to synchronize processes in multi-core system?

0

There are 0 answers