bash脚本共享的Mutex机制& C++
我有几个用C ++编写的过程,访问了关键部分(读/编写文件),并且此访问由MUTEX控制。到目前为止,一切都进展顺利,但是现在我必须重新设计我的平台,并且还有一个bash脚本,也必须读/编写文件。是否有任何实现MUTEX/SMAPHORE/LOCK机制的库/命令,可以在BASH脚本和C ++中使用?
当我不得不在Bash脚本中与Mutex合作时,我曾经用Mkdir创建一个目录 - > shell脚本中有任何sutex/semaphore机制?但是,在这种情况下,我不确定该怎么办。
I have several processes, written in C++, accessing to a critical section (read/write a file) and this access is controlled by a mutex. So far everything has gone well, but now I have to redesign my platform and there is a bash script that also has to read/write the file. Is there any library/command that implements a mutex/semaphore/lock mechanism and can be used in both bash scripts and C++?
When I had to work with mutex in bash scripts, I used to create a directory with mkdir -> Is there any mutex/semaphore mechanism in shell scripts? but I am not very sure what to do in this case.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论