Forum Discussion
Altera_Forum
Honored Contributor
16 years agoThe way _single_ CPU archs that don't have atomic instructions handle Futex (User space Mutex: here interrupt can't be disabled to prohibit a context switch) is to create a "atomic region": a memory page where the would-be atomic instructions sit. On interrupt (-return) the Kernel checks if such an instruction had been interrupted and finishes it before returning after same.
Of course this does not work that easy with multiple CPUs. but here a hardware flag that is set before and reset after the would be atomic instruction by a custom instruction (that other than an I/O access can be executed in user space) could be used to do a spinlock and the interrupt issue might be handled in a similar way as with a single CPU system. -Michael