Hi,

Samuel Thibault wrote:
>> Then must process-shared semaphores and mutexes be implemented in
>> shared memory? or it's completely through IPCs?
> 
> Note that posix mutexes are always shared between processus through
> shared memory anyway (the application is responsible for sharing the
> memory). That can be used for fast locking (through atomics etc) and
> reverting to ports can be done only in the contention case.
> 
> For semaphores, sem_init() behaves the same way. sem_open() is different
> in that it doesn't requires shared memory, but I'd advise to just
> automatically set up a shared memory segment and just work the same.
> 
> Anyway, deciding between shared memory or pure IPC is not really an
> issue.  I believe the more difficult part is how to make process
> actually perform IPCs securely.  It can probably be useful to check how
> shm was implemented.
Do you mean shm device in Linux or in Xen?

Zheng Da


Reply via email to