ipc

How can I obtain a global mutex?

戏子无情 提交于 2020-06-28 09:21:29
问题 I'm trying to generate shared memory in a distributed manner; I also need the solution to be cross-platform. In order to do so, I need to synchronise the initialisation of this shared memory - using a mutex. This mutex, thus, needs to be shared. I've taken a look at this question: Interprocess reader/writer lock with Boost However, it suggests placing the mutex in shared memory, generated by a central process. This is the exact opposite of what I'm wanting to do. If I had this central process

Using Linux POSIX IPC message queue

十年热恋 提交于 2020-06-16 12:54:02
问题 I have to create single Server Process A and multiple client process(es). All should use Linux POSIX IPC message queue for data passing. Message(s) will flow in both direction. It is also possible that at time multiple client process(es) may have registered to Server Process A. Currently I'm using only one named Message queue which is created and Opened by Server Process A and used/opened (only) by client process(es). This works with two process scenario (i.e One server Process A and one

How to read values assigned inside a script, in a program that runs that script?

六月ゝ 毕业季﹏ 提交于 2020-06-16 03:33:30
问题 I need some help with reading value assigned inside sub scripts executed within main script in perl I have "main.pl" where i have few hashes ( %var1 %var2 ) declared and assigned and am processing the values throughout the script. Within main.pl, i execute a perl script "sub_scirpt.pl" using system(perl sub_script.pl) Inside sub.pl, if i am assigning few value to %var1 %var2 How do i print the values assigned in sub_script.pl of %var1 at main.pl script level? Hope the above description gives