Thanks and Regards
 Smital Desai
________________________________________
From: Tayade, Nilesh [[email protected]]
Sent: Wednesday, September 15, 2010 12:35 PM
To: Smital Desai; Kernel Newbies
Subject: RE: spin locks in uniprocessor system

> -----Original Message-----
> From: [email protected] [mailto:kernelnewbies-
> [email protected]] On Behalf Of Smital Desai
> Sent: Wednesday, September 15, 2010 11:58 AM
> To: Kernel Newbies
> Subject: spin locks in uniprocessor system
>
> Hi everyone,
>
> It's an extract in LDD3 , regarding spink lock. I have put my query
> in brackets.
>
> Spinlocks are, by their nature, intended for use on multiprocessor
> systems, although a uniprocessor workstation running a preemptive
> kernel behaves like SMP, as far as concurrency is concerned.
> ( I need to understand , how this is true with an example preferably
> )

>>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.

>
> If a nonpreemptive uniprocessor system ever went into a spin on a
> lock, it would spin forever; no other thread would ever be able to
> obtain the CPU to release the lock. For this reason, spinlock
> operations on uniprocessor systems without pre-emption enabled are
> optimized to do nothing, with the exception of the ones that change
> the IRQ masking status.
> ( I don't get the meaning of last sentence "with the exception of
> ......" Please can somebody explain )
>

>>I am not sure about this statement, though. Would appreciate if someone
>>can provide some pointers.

>
> Thanks and Regards
>  Smital Desai
>


--
Thanks,
Nilesh





______________________________________________________________________

This Email may contain confidential or privileged information for the intended 
recipient (s) If you are not the intended recipient, please do not use or 
disseminate the information, notify the sender and delete it from your system.

______________________________________________________________________

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to [email protected]
Please read the FAQ at http://kernelnewbies.org/FAQ

Reply via email to