bash脚本共享的Mutex机制& C++

发布于 2025-02-11 11:17:53 字数 404 浏览 1 评论 0原文

我有几个用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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文