Re: Semaphore

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Santosh,

On Tue, Feb 21, 2012 at 5:47 AM, SaNtosh kuLkarni
<santosh.yesoptus@xxxxxxxxx> wrote:
> A certain  kernel process has acquired a semaphore lock and meanwhile during
> this period the process gets killed abruptly (and it has not released the
> sem lock..//.sem down).....and the other processes cannot acquire the lock,
> what can be done in this case.

Normally, the semaphore would be associated with a driver of some
type. If the process opened the driver, then regardless of how the
process dies, the file that was opened by the process will eventually
be closed by the kernel and the driver's release function will get
called. This gives you the opportunity to release the semaphore. The
driver would be responsible for tracking the state of the semaphore.
Fundamentally the driver is responsible for cleaning up all of the
resources that it may be using, and a semaphore is just another
resource, like memory.

I'm assuming that the semaphore is one which is held across multiple
calls into the kernel, otherwise you don't have an issue in the first
place, unless there is a bug on the kernel side of things which
actually caused the process to terminate.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux