Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

i have studied that for process to communicate with each other they need to keep their critical region in shared memory,so that other process which needs access to that can use it,using different variables for mutual exclusion,like semaphore and lock.

but where is this shared memory located,is that the same shared memory /dev/shm that we see when we do df -h.Sometimes /dev/shm is using some space sometimes not.why is it so.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

You can create shared memory several ways. You can memory map the same file shared in both processes. Or you can uses sysv shared memory with shm_open.

share|improve this answer
    
so does /dev/shm that we see also serves the same purpose.So why clearing the contents in /dev/shm does not make any difference? –  Kevin Parker Aug 15 '12 at 10:55
1  
/dev/shm is just one mechanism of creating shared memory. It's basically memory mapping the same file in both processes, except the file is backed only by memory. –  David Schwartz Aug 15 '12 at 11:03

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.