What is the POSIX equivalent of Win32 Mutex?

POSIX is mutexequivalent to Win32 CRITICAL_SECTION- its scope is limited to one process. Win32 mutex (Actually called the "mutant" on NT ground) serves as a mechanism for blocking the cross process. What is the pthreads equivalent for cross processes?

+5
source share
2 answers

This is pthread_mutex_t with the pshared attribute set to PTHREAD_PROCESS_SHARED. However, you are responsible for placing such a mutex in shared memory that all processes can access - so it is not as simple as win32 api.

, win32 posix sysv . , . flock lockf ( , )

+6

IPC -: , , . , . :

man 7 sem_overview
0

All Articles