Maxim
Fri Jul 01 16:24:25 CDT 2005
"Another instance of this thread" is nonsense. Mutex allows only 1 thread
to enter, and this guarantee is also valid on SMP, regardless of on what CPU
threads run.
Spinlocks are only used (usually) to guard the access from the several
contexts, some of them are DISPATCH_LEVEL.
--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com
<liquidl@email.com> wrote in message
news:1120178582.962868.198570@g49g2000cwa.googlegroups.com...
> Hi,
>
> Do mutexes protect against concurrent access from another CPU? I have
> a worker thread which acquires a mutex before a critical section and
> then releases it. If, on an SMP machine, another instance of this
> thread executes, would it also be serialized by the same mutex?
>
> Also, generally speaking, when is it better to use spinlocks? My
> driver uses mutexes only.
>
> Regards,
>
> James
>