0

There system V has three ipc ways: MessageQueue, SharedMemory, Semaphore。 When two processes read or write on it simultaneously, should i use some synchronization like threads lock?

And POSIX IPC?

billow
  • 125
  • 1
  • 1
  • 9

1 Answers1

1

If two process read/write MessageQueue, you don't need additional protection. But if two process read/write SharedMemory, you may use Semaphore to protect.

Given your question, if two processes read/write them, how thread lock could help? Thread lock only works internal to a process.

TieDad
  • 9,143
  • 5
  • 32
  • 58