Wednesday, Jul 17th

Last update12:59:40 PM GMT

Welcome, Guest
Please Login or Register.    Lost Password?

[SOLVED] spinlock deadlock
(1 viewing) (1) Guest
Questions on Open Source - the next big wave!!
Go to bottomPage: 1
TOPIC: [SOLVED] spinlock deadlock
#125
[SOLVED] spinlock deadlock 8 Years, 8 Months ago Karma: 0
I was asked an interview question..........was tensed and could not answer the question.......

Q: Suppose a spin lock is taken by a kernel thread and ISR is called .........this ISR needs to acquire the spinlock. How can the ISR proceed? It can't proceed ............so what is the solution??

I was awestruck ...........please help me with the answer.
admin
Inquisitive
Posts: 8
graphgraph
User Offline Click here to see the profile of this user
Last Edit: 2011/01/19 14:08 By admin.
The administrator has disabled public write access.
 
#127
Re: spinlock deadlock 8 Years, 8 Months ago Karma: 0
When a thread is spinning for lock , arent interrupts disabled? Or am I missing out something.. cn u be more precise?
admin
Inquisitive
Posts: 2
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#205
Re: spinlock deadlock 8 Years, 6 Months ago Karma: 0
Obviously, in an ISR interrupts are disabled.
admin
Inquisitive
Posts: 8
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
#207
Re: spinlock deadlock 8 Years, 6 Months ago Karma: 0
basic functions spin_lock() and spin_unlock() don't take care of disabling and enabling the softirqs. Hence you might fall into trouble if you use these variants of spin lock in your kernel codes.

spin_lock_bh()
spin_unlock_bh()

take care of disabling softirqs when taken and re enable it when yielded.
admin
Inquisitive
Posts: 1
graphgraph
User Offline Click here to see the profile of this user
The administrator has disabled public write access.
 
Go to topPage: 1
get the latest posts directly to your desktop

Web Hosting