* RE: Mutual Exclusion in Kernel
[not found] <577528CFDFEFA643B3324B88812B57FE2D9B67@inhyms21.ca.com>
@ 2004-10-06 5:50 ` Ankit Jain
2004-10-06 8:43 ` Robin Doer
0 siblings, 1 reply; 4+ messages in thread
From: Ankit Jain @ 2004-10-06 5:50 UTC (permalink / raw)
To: Dhiman, Gaurav; +Cc: newbie
hi
what is spin lock?
thanks
ankit
--- "Dhiman, Gaurav" <Gaurav.Dhiman@ca.com> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: Mutual Exclusion in Kernel
2004-10-06 5:50 ` Ankit Jain
@ 2004-10-06 8:43 ` Robin Doer
2004-10-07 5:18 ` kernel kernel
0 siblings, 1 reply; 4+ messages in thread
From: Robin Doer @ 2004-10-06 8:43 UTC (permalink / raw)
To: newbie
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 <something> until <something> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Mutual Exclusion in Kernel
[not found] <20041006085523.35414.qmail@web52903.mail.yahoo.com>
@ 2004-10-06 14:04 ` Robin Doer
0 siblings, 0 replies; 4+ messages in thread
From: Robin Doer @ 2004-10-06 14:04 UTC (permalink / raw)
To: Ankit Jain; +Cc: linux-newbie
[-- Attachment #1: Type: text/plain, Size: 1440 bytes --]
No!
You have to write your own busy-waiting-algorithm while the operating system
provides you a semaphore.
A busy-waiting-algorithm can be compared with a two-state-semaphore (lock or
unlock) but the concept of the semaphore is must more powerful. In theory an
infinite number of states is possible. Thus you can control the access to a
resource in different levels.
Am Mittwoch, 6. Oktober 2004 10:55 schrieben Sie:
> but this is like semaphore?
>
> thanks again
>
> ankit
>
> --- Robin Doer <robin@robind.de> 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 <something>
> > until <something> 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
>
> ________________________________________________________________________
> Yahoo! Messenger - Communicate instantly..."Ping"
> your friends today! Download Messenger Now
> http://uk.messenger.yahoo.com/download/index.html
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Mutual Exclusion in Kernel
2004-10-06 8:43 ` Robin Doer
@ 2004-10-07 5:18 ` kernel kernel
0 siblings, 0 replies; 4+ messages in thread
From: kernel kernel @ 2004-10-07 5:18 UTC (permalink / raw)
To: Robin Doer; +Cc: newbie
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 <robin@robind.de> 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 <something> until <something> 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2004-10-07 5:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20041006085523.35414.qmail@web52903.mail.yahoo.com>
2004-10-06 14:04 ` Mutual Exclusion in Kernel Robin Doer
[not found] <577528CFDFEFA643B3324B88812B57FE2D9B67@inhyms21.ca.com>
2004-10-06 5:50 ` Ankit Jain
2004-10-06 8:43 ` Robin Doer
2004-10-07 5:18 ` kernel kernel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox