Re: recursive locks in linux

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

 




Spinlocks, semaphores & Mutexes defnitely can't be used.

Although the RW semaphores and RW spinlocks allow recursive locking
(since multiple threads can simultaneously hold reader locks).


--------------- response from Gaurav Dhiman  starts -----------------------

Rajat read-write locks are not recursive in nature, as the same thread can
not again acquire the lock once it has already acquired the lock. There are
no recursive lock avaialble and should not be avialable, as recursive locks
lead to deadlock. When thread tries to acquire the lock for second time
recursively, it will be put on hold or spin forever waiting for the lock to
be release which the thread has itself acquired, leading it to deadlock.

regards,

Gaurav
------------------- response from Gaurav Dhiman ends --------------------


Hi Gaurav,

Umm ... pardon my ignorance, but I cannot imagine why a process cannot
again attempt to acquire the read lock (read_lock()) without getting
deadlocked ... although it won't MAKE any sense to reacquire a read
lock.

Thanks

Rajat

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[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