POSIX Shared memory -


what difference between:

  1. shm_open("test")
  2. mmap()
  3. close()
  4. munmap()
  5. shm_unlink()

and:

  1. open("/dev/shm/test")
  2. mmap()
  3. close()
  4. munmap()
  5. unlink()

the difference see second options not need link -lrt

it same thing except shm_open(test) posix standard , needs librt library, , open(/dev/shm/test) not posix standard , not need librt library. performance equal both solution.


Comments

Popular posts from this blog

c++ - rosrun via ssh doesnt start a node properly -

android - questions about switching from C2DM to GCM -

Error C2280 mutex in a class C++ -