0

I want to split the shared memory in reasonable pieces, but have no idea, which number is good? Are 100 shared memory handles for one application a reasonable number?

P.S: I have a produces/consumer problem. A producer writes data in shared memory, one or many consumers read the data time-shifted. The producer and the consumers should never access the same data-block. The consumers may try to access and modify the same memory-blocks. The consumer access should be managed by semaphores.

The single data-block is ca. 30kB and the entire shared memory is about 1GB. Using ca 100 pieces would for sure prevent locking for producer/consumer and minimize the number of locks required among the consumers.

Valentin H
  • 7,240
  • 12
  • 61
  • 111
  • are you looking for something like this? http://stackoverflow.com/questions/22207546/shared-memory-ipc-synchronization-lock-free – ibre5041 Apr 19 '16 at 07:50
  • @ibre5041 "Now the age-old question: How to synchronize them effectively!?" - No. I have rather the platform questions - how many POSIX shared memory handles are a good choice. – Valentin H Apr 19 '16 at 08:07

0 Answers0