[英]How can I restrict the number of instances of my C program?
Title says it all, I need to only allow one instance of my C program to be run. 标题说明了一切,我只需要允许运行我的C程序的一个实例。 How can I accomplish this? 我该怎么做?
You can use shared memory for this purpose. 您可以为此目的使用共享内存。 Shared memory is an OS-level mechanism. 共享内存是操作系统级别的机制。
You can use the shared memory to store the specific number of instances your app is allowed to run. 您可以使用共享内存来存储允许您的应用程序运行的特定实例数。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.