RE: Mutual Exclusion in Kernel

RE: Mutual Exclusion in Kernel

am 06.10.2004 07:50:17 von ankitjain1580

hi

what is spin lock?

thanks

ankit
--- "Dhiman, Gaurav" wrote:
>
> Use either semaphore or spin locks for mutual
> exclusion
>
> Gaurav
>
>
> -----Original Message-----
> From: kernelnewbies-bounce@nl.linux.org
> [mailto:kernelnewbies-bounce@nl.linux.org] On Behalf
> Of Rakesh Jagota
> Sent: Wednesday, October 06, 2004 9:03 AM
> To: kernelnewbies
> Subject: Mutual Exclusion in Kernel
>
> Hello All,
>
> I have defined one array of structures in the kernel
> which can be seen
> by
> all the modules. Now I would like to have mutual
> exclusion , that is if
> any
> module is accessing the array ,no other module
> should not access the
> same
> array, since it is a global array.
>
> Thanks in advance
>
> Regards
> Rakesh
>
>
> --
> Kernelnewbies: Help each other learn about the Linux
> kernel.
> Archive:
> http://mail.nl.linux.org/kernelnewbies/
> FAQ: http://kernelnewbies.org/faq/
>
>
>
> --
> Kernelnewbies: Help each other learn about the Linux
> kernel.
> Archive:
> http://mail.nl.linux.org/kernelnewbies/
> FAQ: http://kernelnewbies.org/faq/
>
>

____________________________________________________________ ____________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

RE: Mutual Exclusion in Kernel

am 06.10.2004 10:43:20 von Robin Doer

Good morning!

Ankit Jain (ankitjain1580@yahoo.com) schrieb:
>
> hi
>
> what is spin lock?

http://en.wikipedia.org/wiki/Spin_lock

aka "busy waiting". A thread is polling until says
"ok" and the thread continues working.

>
> thanks
>
> ankit

Have fun,
Robin

-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs

Re: Mutual Exclusion in Kernel

am 07.10.2004 07:18:09 von kernel kernel

Hi All,

Spin lock is a mutual exclusion strategy which is used in
Multiprocessor machanies.

When i resource is not available for a particular thread, it wont be
removed from TASK_RUNNING status and put into the corresponding event
Q. Instead it will loop around the processor, in closed cycles until
the resource is available.

So when the thread which currently owns the resource in other
processor leaves the resource, the loop thread can access the
resource. This can avoid the Thundering Herd problem as well as the
overhead of pushing the thread into the Event Q..

Thanks
Amrith


On Wed, 06 Oct 2004 10:43:20 +0200, Robin Doer wrote:
> Good morning!
>
> Ankit Jain (ankitjain1580@yahoo.com) schrieb:
> >
> > hi
> >
> > what is spin lock?
>
> http://en.wikipedia.org/wiki/Spin_lock
>
> aka "busy waiting". A thread is polling until says
> "ok" and the thread continues working.
>
> >
> > thanks
> >
> > ankit
>
> Have fun,
> Robin
>
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.linux-learn.org/faqs
>
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs