
Anthony Williams wrote:
Ion Gazta?aga <igaztanaga@gmail.com> writes:
Peter Dimov wrote:
Ion Gazta?aga wrote:
Does this support building those objects in mapped files, rebooting the system, mapping the file again again and continue working? [snip] However, I would not expect the mutex to survive a reboot --- there might still be data in the file, but I would expect a process-shared mutex to have at least some portion that was a handle to a kernel object, and the kernel object would go away with a reboot.
I have no idea what the POSIX spec requires or what most implementations actually do. But I believe that the Linux implementation, using the futex() system call, probably can survive a reboot as it has no permanent kernel component. The kernel only gets involved when a process finds the mutex locked, and needs to wait. See 'man 2 futex'. Of course the pthread_* functions, which wrap the futex() functionality, may make it impossible to exploit this behaviour. Phil.