|
Example for use of kernel semaphore
Hi friends I'm doing a project and in that I need to use kernel semaphore but I'm not very clear about how to use it. I've used system V semaphore.
What I find difficult to understand is that in system V semaphore, a semaphore set is registered to the system (the semid returned from semget call is unique and can identify the semaphore set) allowing synchronisation between processes as against this in kernel semaphore it seems to me only a instance of structure semaphore needs to be created and up() and down() called upon it for synchronisation. But how can an instance of structure declared in one program be known in other program.
May be I'm thinking wrong way plz. rectify me if so and plz. show me an example how to use kernel semaphore.
Thanks in advance
Last edited by Rakesh Ranjan; 03-16-2006 at 05:01 AM..
|