Difference with the synchronization primitives

Hi,

I am having a feeling that I use too many ERESOURCE objects to control synchronization. I need to protect a global integer which may get changed in different thread context. Can fast spin lock do the work? Is it faster then ExAcquireResource? Under what condition ERESOURCE is a must?

Thanks!!

Lijun


Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now

Why can’t you use Interlocked* operations instead of explicit locks?
You will need to tell us about the synchronization needs in greater
detail for a better, finegrained response.
Ravi

-----Original Message-----
From: Lijun Wang [mailto:xxxxx@yahoo.com]
Sent: Friday, January 17, 2003 3:31 PM
To: File Systems Developers
Subject: [ntfsd] Difference with the synchronization primitives

Hi,
I am having a feeling that I use too many ERESOURCE objects to control
synchronization. I need to protect a global integer which may get
changed in different thread context. Can fast spin lock do the work? Is
it faster then ExAcquireResource? Under what condition ERESOURCE is a
must?
Thanks!!
Lijun

Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now — You are
currently subscribed to ntfsd as: xxxxx@windows.microsoft.com To
unsubscribe send a blank email to xxxxx@lists.osr.com

For a simple integer it is probably faster, though harder in coding
to use InterlockedXXX functions.


Kind regards, Dejan M. www.alfasp.com
E-mail: xxxxx@alfasp.com ICQ#: 56570367
Alfa File Monitor - File monitoring library for Win32 developers.
Alfa File Protector - File protection and hiding library for Win32
developers.

Surely spinlock is faster then ERESOURCE.

ERESOURCE is intended for shared/exclusive semantics, and also to release the grabbed lock from the thread other then grabbed it. For instance, the app’s thread grabs it, and the Cc’s lazy writer releases it.

Max

----- Original Message -----
From: Lijun Wang
To: File Systems Developers
Sent: Saturday, January 18, 2003 2:30 AM
Subject: [ntfsd] Difference with the synchronization primitives

Hi,

I am having a feeling that I use too many ERESOURCE objects to control synchronization. I need to protect a global integer which may get changed in different thread context. Can fast spin lock do the work? Is it faster then ExAcquireResource? Under what condition ERESOURCE is a must?

Thanks!!

Lijun


Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now — You are currently subscribed to ntfsd as: xxxxx@storagecraft.com To unsubscribe send a blank email to xxxxx@lists.osr.com