Xu Yang | 3 Sep 20:03 2007

mutex vs cache coherency protocol

Hello everyone,

Just got a rough question in my head.

don't know whether anyone interested .

mutex vs cache coherency protocol(for multiprocessor)

both of these two can be used to protect shared resource in the memory.

are both of them necessary?

for example:

in a multiprocessor system, if there is only mutex no cache coherency.
obviously this would cause problem.

what about there is no mutex mechanism, only cache coherency protocol
in multiprocessor system? after consideration, I found this also could
casue problem, when the processors are multithreading processors,
which means more than one threads can be running on one processor. in
this case if we only have cache coherency and no mutex, this would
cause problem. because all the threads running on one processor share
one cache, the cache coherency protocol can not be functioning
anymore. the shrared resource could be crashed by different threads.

then if all the processors in the multiprocessor system are sigle
thread processor, only one thread can be running one one processor. is
it ok, if we only have cache coherency protocol ,no mutex mechanism?

(Continue reading)

Robert M. Hyatt | 3 Sep 23:44 2007
Picon

Re: mutex vs cache coherency protocol


what about the kernel?  How will it protect itself when multiple 
processors execute kernel code???

Robert M. Hyatt, Ph.D.          Computer and Information Sciences
hyatt <at> uab.edu                   University of Alabama at Birmingham
(205) 934-2213                  136A Campbell Hall
(205) 934-5473 FAX              Birmingham, AL 35294-1170

On Mon, 3 Sep 2007, Xu Yang wrote:

> Hello everyone,
> 
> Just got a rough question in my head.
> 
> don't know whether anyone interested .
> 
> mutex vs cache coherency protocol(for multiprocessor)
> 
> both of these two can be used to protect shared resource in the memory.
> 
> are both of them necessary?
> 
> for example:
> 
> in a multiprocessor system, if there is only mutex no cache coherency.
> obviously this would cause problem.
> 
> what about there is no mutex mechanism, only cache coherency protocol
> in multiprocessor system? after consideration, I found this also could
(Continue reading)

Mohamed Bamakhrama | 4 Sep 00:54 2007
Picon

Re: mutex vs cache coherency protocol

On 9/3/07, Xu Yang <risingsunxy <at> googlemail.com> wrote:
> Hello everyone,
>
> Just got a rough question in my head.
>
> don't know whether anyone interested .
>
> mutex vs cache coherency protocol(for multiprocessor)
>
> both of these two can be used to protect shared resource in the memory.
>
> are both of them necessary?
>
> for example:
>
> in a multiprocessor system, if there is only mutex no cache coherency.
> obviously this would cause problem.
>
> what about there is no mutex mechanism, only cache coherency protocol
> in multiprocessor system? after consideration, I found this also could
> casue problem, when the processors are multithreading processors,
> which means more than one threads can be running on one processor. in
> this case if we only have cache coherency and no mutex, this would
> cause problem. because all the threads running on one processor share
> one cache, the cache coherency protocol can not be functioning
> anymore. the shrared resource could be crashed by different threads.
>
> then if all the processors in the multiprocessor system are sigle
> thread processor, only one thread can be running one one processor. is
> it ok, if we only have cache coherency protocol ,no mutex mechanism?
(Continue reading)

cerise | 4 Sep 00:56 2007

Re: mutex vs cache coherency protocol

Exactly -- cache coherency ensures that things are only modified once by a
series of processors, but it doesn't ensure that a given, necessarily atomic
sequence of operations is executed by only a single thread of operation.

I'm not entirely sure a kernel couldn't be built using only cache coherency
to prevent deadlocks.  Something like a delegate system where you queue up
requests through a single operation seems like it would do, but ultimately,
you're just making a complicated mutex at that point.

-Phil/CERisE

On Mon, Sep 03, 2007 at 04:44:56PM -0500, Robert M. Hyatt wrote:
> 
> what about the kernel?  How will it protect itself when multiple 
> processors execute kernel code???
> 
> 
> Robert M. Hyatt, Ph.D.          Computer and Information Sciences
> hyatt <at> uab.edu                   University of Alabama at Birmingham
> (205) 934-2213                  136A Campbell Hall
> (205) 934-5473 FAX              Birmingham, AL 35294-1170
> 
> On Mon, 3 Sep 2007, Xu Yang wrote:
> 
> > Hello everyone,
> > 
> > Just got a rough question in my head.
> > 
> > don't know whether anyone interested .
> > 
(Continue reading)

Xu Yang | 4 Sep 10:58 2007

Re: mutex vs cache coherency protocol

Hi Robert,

could you explain more about it, I am quite interested in this.

thanks,

regards,

Yang

2007/9/3, Robert M. Hyatt <hyatt <at> cis.uab.edu>:
>
> what about the kernel?  How will it protect itself when multiple
> processors execute kernel code???
>
>
> Robert M. Hyatt, Ph.D.          Computer and Information Sciences
> hyatt <at> uab.edu                   University of Alabama at Birmingham
> (205) 934-2213                  136A Campbell Hall
> (205) 934-5473 FAX              Birmingham, AL 35294-1170
>
> On Mon, 3 Sep 2007, Xu Yang wrote:
>
> > Hello everyone,
> >
> > Just got a rough question in my head.
> >
> > don't know whether anyone interested .
> >
> > mutex vs cache coherency protocol(for multiprocessor)
(Continue reading)

Xu Yang | 4 Sep 10:59 2007

Re: mutex vs cache coherency protocol

Hi Mohanmed,

thanks for you recommand, I have ordered this book.

2007/9/4, Mohamed Bamakhrama <bamakhrama <at> gmail.com>:
> On 9/3/07, Xu Yang <risingsunxy <at> googlemail.com> wrote:
> > Hello everyone,
> >
> > Just got a rough question in my head.
> >
> > don't know whether anyone interested .
> >
> > mutex vs cache coherency protocol(for multiprocessor)
> >
> > both of these two can be used to protect shared resource in the memory.
> >
> > are both of them necessary?
> >
> > for example:
> >
> > in a multiprocessor system, if there is only mutex no cache coherency.
> > obviously this would cause problem.
> >
> > what about there is no mutex mechanism, only cache coherency protocol
> > in multiprocessor system? after consideration, I found this also could
> > casue problem, when the processors are multithreading processors,
> > which means more than one threads can be running on one processor. in
> > this case if we only have cache coherency and no mutex, this would
> > cause problem. because all the threads running on one processor share
> > one cache, the cache coherency protocol can not be functioning
(Continue reading)

Robert M. Hyatt | 4 Sep 19:26 2007
Picon

Re: mutex vs cache coherency protocol

the kernel executes code on behalf of users all the time.  For example, 
to queue up I/O requests, to read files, to handle network connections, 
to allocate/free memory, to send signals, and a zillion other things.  
Many of these operations require modification of something called "a 
serially-reusable resource" which is just a fancy name for something 
that can only be used by one user at a time.  A stall in a men's 
restroom is an example.  Or, in this case, perhaps it is just a simple 
linked list.  If two processors were to try to insert or remove (or a 
combination of both) things on a list at the same time, race conditions 
can arise and the data can become unusable.  So we use a spinlock to 
prevent multiple processors from modifying the same data structure at 
the same time...

Robert M. Hyatt, Ph.D.          Computer and Information Sciences
hyatt <at> uab.edu                   University of Alabama at Birmingham
(205) 934-2213                  136A Campbell Hall
(205) 934-5473 FAX              Birmingham, AL 35294-1170

On Tue, 4 Sep 2007, Xu Yang wrote:

> Hi Robert,
> 
> could you explain more about it, I am quite interested in this.
> 
> thanks,
> 
> regards,
> 
> Yang
> 
(Continue reading)


Gmane