* mutex vs cache coherency protocol(for multiprocessor )
@ 2007-09-03 17:57 Xu Yang
2007-09-04 12:59 ` Chris Snook
0 siblings, 1 reply; 2+ messages in thread
From: Xu Yang @ 2007-09-03 17:57 UTC (permalink / raw)
To: LKML
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?
anyone has any idea? all the comments are welcome and appreciated,
including criticism.
regards,
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: mutex vs cache coherency protocol(for multiprocessor )
2007-09-03 17:57 mutex vs cache coherency protocol(for multiprocessor ) Xu Yang
@ 2007-09-04 12:59 ` Chris Snook
0 siblings, 0 replies; 2+ messages in thread
From: Chris Snook @ 2007-09-04 12:59 UTC (permalink / raw)
To: Xu Yang; +Cc: LKML
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
> 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?
>
> anyone has any idea? all the comments are welcome and appreciated,
> including criticism.
Cache coherency is necessary for SMP locking primitives (and thus Linux SMP
support), but it is hardly sufficient. Take a look at all the exciting inline
assembly in include/asm/ for spinlocks, atomic operations, etc.
-- Chris
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-09-04 12:59 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-03 17:57 mutex vs cache coherency protocol(for multiprocessor ) Xu Yang
2007-09-04 12:59 ` Chris Snook
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.