Are there critical sections of C ++ 11?

I am trying to find the equivalent of a critical section for C ++ 11, is the new mutex C ++ 11 -bound concept (for example, forcibly uses a mutex only in user space)? Perhaps this is a specific implementation, since I cannot find anything specific. Perhaps C ++ 11 has its critical section classes, since mutexes are cross-process, right? Please, help.

+4
source share
2 answers

The standard library implementation can freely use any mutex implementation that they like, which meets the requirements and behavior set forth in the standard. An implementation that provides an interworking process lock that is not required by the standard is more likely to be less effective than one that does not. Thus, a high-quality implementation is likely to provide local process mutexes (mutices?).

Thus, although it would be possible to implement a consistent implementation of C ++ 11 mutexes using, for example, the named semaphores, it would be difficult to sell this implementation to users. As far as I know, there is no popular implementation that provides cross-process locking in std::mutex.

+7
source

++ , , ; , . , Posix "", -, ++ -. , , .

: , -, mmap , .

+1

Source: https://habr.com/ru/post/1539580/


All Articles