System-wide global variable / semaphore / mutex in C++/Linux?
问题 Is it possible to create a system-wide global variable / semaphore / mutex in C++ on Linux? Here's the reason: I've got a system that often runs multiple copies of the same software on unrelated data. It's common to have 4 jobs, each running the same software. The software has a small section where it creates a huge graph that takes a lot of memory; outside that section memory usage is moderate. It so happens sometimes that 2 jobs simultaneously hit the same memory-hungry section and the