> -----Original Message----- > From: Smital Desai [mailto:Smital.Desai@xxxxxxxxxxxxxxx] > Sent: Wednesday, September 15, 2010 12:58 PM > To: Tayade, Nilesh; Kernel Newbies > Subject: RE: spin locks in uniprocessor system > > > > >>On uniprocessor system even if you have a task scheduled, the > interrupt > >>can still come and should be handled by that processor. So let's > say you > >>get a timer interrupt - the schedule() will be called on return > and if > >>there is any higher priority task waiting, your previous task can > get > >>scheduled out. > >>This is referred to as pseudo concurrency (Please refer Robert > Love). > > ok .. i might sound silly but in this case too.. When the > second task tries to acquire > the same spin lock , it will again cause the processor to spin > continuously hogging it completely .. > then how does the first task gets a chance to execute and > release the spin lock. > CMIIW, pertaining to the uniprocessor system, the first task will get a chance only when it has priority greater than any other tasks. To avoid such things, maybe we can go for non-blocking operations before acquiring spinlock. int spin_trylock(spinlock_t *lock); int spin_trylock_bh(spinlock_t *lock); -- Thanks, Nilesh -- To unsubscribe from this list: send an email with "unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx Please read the FAQ at http://kernelnewbies.org/FAQ