Quote:
Originally Posted by ebd
supplement:
it seems a bit troublesome to define a respective mutex for every shared var
|
In that case, why not just define one global mutex for all shared variables? It works out almost the same as a global critical lock.
AFA a critical section, in userspace no such mechanism exists.
In kernel space, there are many different types of critical sections, but the most basic is via disabling all interrupts across all cpus. I'm assuming that you're not in kernel space, however.