c - Method to read a message twice from Linux IPC Message Queues -


this question has answer here:

whenever message read message queue, message deleted kernel.

  1. is possible read same message twice?
  2. how can read same message twice in same process or in 2 different processes?

you can't read twice queue, reading without removing called peeking , cannot peek in posix queue. read mq_overview(7).

you should design software avoid having read twice same data queue (e.g. adding appropriate buffering, perhaps serialized or locked mutex).


Comments