Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Is that correct that a mutex object in Linux cannot be used for cross process synchronization as opposed to its Windows counterpart?

If that is true - what was the idea to limit mutex synchronisation functionality on Linux?

share|improve this question
1  
or it is the other way around: windows mutex was implemented with more functionality than the linux mutex –  ratchet freak Jun 8 '13 at 11:25
    
you could say that, but from what I remember the first version of linux was released when windows os was already out. just interested why there a difference in the functionality ... –  Mitten Jun 8 '13 at 14:40
    
but was a mutex implementation involved in both releases? don't forget upgraded that M$ would have done –  ratchet freak Jun 8 '13 at 15:00

1 Answer 1

The difference is kind of "made up", on windows MUTEX is very rarely used, and even then no really for sync but to discover already runnin instance of the program. What has wide use is CRITICAL_SECTION, and it is close equivalent of recursive mutex on linux, solaris and others.

share|improve this answer
3  
I have seen the "discover an already running instance" on unix based implemented by opening a port. Since only one process can hold a port open, the second process knows the first process exists and can exchange communication with it (or refuse to start up because only one instance should be running at a time). –  MichaelT Jun 9 '13 at 1:20

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.