0

I just read this page of the Boost.Interprocess documentation. It seems to suggest that in order to accommodate the differences among different operating systems and come to some agreement, certain interprocess mechanisms are not implemented with the directly corresponding native mechanism provided by the operating system, but instead emulated using other mechanisms. I'm wondering whether this may impose a considerable performance hit.

The last section on that page is particularly concerning to me, which is cited below

Since each mechanism can be emulated through diferent mechanisms (a semaphore might be implement using mapped files or native semaphores) permissions types could vary when the implementation of a named resource changes (eg.: in Windows mutexes require synchronize permissions, but that's not the case of files). To avoid this, Boost.Interprocess relies on file-like permissions, requiring file read-write-delete permissions to open named synchronization mechanisms (mutex, semaphores, etc.) and appropiate read or read-write-delete permissions for shared memory. This approach has two advantages: it's similar to the UNIX philosophy and the programmer does not need to know how the named resource is implemented.

Based on this text, I'm guessing that most of the kernel objects provided natively by Windows for interprocess synchronization (e.g, Event, Mutex, Semaphore) are just not used by Boost.Interprocess.

Phil Miller
  • 36,389
  • 13
  • 67
  • 90
Lingxi
  • 14,579
  • 2
  • 37
  • 93
  • 1
    read the source, benchmark, don't outsource this to SO – MK. Oct 09 '15 at 16:15
  • Boost has platform-specific code for both Posix systems (such as Linux) and for Windows, as well as a generic version built on shared memory. – Ben Oct 09 '15 at 16:17

1 Answers1

1

I've seen before that native kernel objects are used.

As I read it, the message speaks of permissions only.

It mentions that this is emulated in case the underlying objects have different access control. It doesn't actually mention how it's emulated.

sehe
  • 374,641
  • 47
  • 450
  • 633