LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 04-05-2009, 10:58 AM   #1
linqu
LQ Newbie
 
Registered: Apr 2009
Posts: 1

Rep: Reputation: 0
Question on spinlock???


Im an Embedded Systems engineer but a newbie to Linux Device Drivers programming and so trying to get a understanding of Linux Device Drivers by reading "Linux Device Drivers, 3rd Edition". My question is in chapter 5 where the spinlock is introduced the author explains that In Single processor system if pre-emption is disabled and if some thread tried to acquire spinlock, and if nobody releases that spinlock, then processor would spin forever in that thread which I think is understandable and so there are implementation changes on spinlock for non-preemtible kernel. But subsequently the author again mentions that pre-emption should be disabled while holding the spinlock on a pre-emptible kernel to take care of the situation where the thread which acquired the spinlock shouldnt release the processor to any other thread. So now the situation is almost similar to the problem which the author explained above. If I acquired a spinlock but if I try to acquire another spinlock then again the processor is stuck in that thread because pre-emption is again disabled. Is this true and something needs to be taken care by the programmer?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
spinlock example programs ashok449 Linux - Kernel 1 07-28-2008 10:28 PM
What's a spinlock? TheLateJC Programming 3 05-18-2007 09:19 AM
Spinlock Recursion wahming Linux - General 2 02-15-2007 02:44 AM
spinlock error culin Linux - Hardware 1 09-28-2006 12:29 AM
spinlock <-> IRQ Problem ruhl22 Programming 1 10-05-2004 09:35 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration