Saturday, August 17, 2013

Whats the differents between sharing a semaphore between threads of a process and sharing one between processes?

Whats the differents between sharing a semaphore between threads of a
process and sharing one between processes?

I am currently learning POSIX threads and working on getting to grips with
concurrency as a whole. I am now looking at the man page for sem_init().
It takes an argument to define whether the semaphore passed to it is to be
shared between threads (zero) or to be shared between processes (non
zero). Could somebody give me a good explanation of the differences here.
I think I understand the basics but some advice and clarification would be
most appreciated.
Many thanks in advance...

No comments:

Post a Comment