"同时互斥锁的作用域仅仅在于线程,信号量可以作用于线程和进程。" 看到说,Mutex也可以用于跨进程间,比如同一个Mutex。这样对吗? https://stackoverflow.com/questions/9389730/is-it-possible-to-use-mutex-in-multiprocessing-case-on-linux-unix "The process-shared attribute is set to PTHREAD_PROCESS_SHARED to permit a mutex to be operated upon by any thread that has access to the memory where the mutex is allocated, even if the mutex is allocated in memory that is shared by multiple processes"
点赞

相关推荐

02-23 00:10
湖南大学 C++
点赞 评论 收藏
分享
03-20 18:39
已编辑
电子科技大学 C++
点赞 评论 收藏
分享
牛客网
牛客企业服务