Is there a difference between Boost's scoped mutex and WinAPi's critical section?

前端 未结 2 1629
灰色年华
灰色年华 2020-12-09 12:36

In Windows environment, is Boost\'s scoped mutex using WinAPI\'s critical sections, or something else?

2条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-09 13:40

    Win32's CRITICAL_SECTION can only be used among the threads of a single process. If you need to use something between processes, you need a mutex. Boost says nothing about critical sections so I would assume it is using mutexes.

    "scoped" just means it has a wrapper that uses RAII to automatically unlock the mutex at the end of a particular scope.

提交回复
热议问题