Structure Locking.

I’m making a file-system-filter-driver(FSFD).
Many structures are used to store various kind of information.

For example,
typedef struct _Alink
{
VOID data;
ULONG size;
struct _Alink *prev;
struct _Alink *next;
}Alink, *pAlink;

Structures are linked with Doubly-Linked-List.

Structure-lists are inserted and deleted frequently.
Search operations are often executed to find specific list(with specific
data), too.
It seems that my driver needs lock to protect structure operation in
multi-cpu environment.
What kind of lock would be proper? And How?

Brief sample code would be a great help to me.
Any answer’ll be great appreciated!

Best regards.
mynam.

> What kind of lock would be proper? And How?

FAST_MUTEX is OK for any data which is never accesses from >= DISPATCH_LEVEL.
If some data is accessed from >= DISPATCH_LEVEL - then spinlock is the only
chance.

Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

OK, this has to be the most basic question ever asked on this list. Are
newbie’s to damn lazy to read the DDK documents before starting on driver
development?

Doe anyone know how to spell “spinlock”; how about “mutex”?

The kernel provides a plethora of synchronization objects; RTFM.

Jamey Kirby, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]
On Behalf Of mynam
Sent: Thursday, August 14, 2003 2:53 AM
To: Windows System Software Developers Interest List
Subject: [ntdev] Structure Locking.

I’m making a file-system-filter-driver(FSFD).
Many structures are used to store various kind of information.

For example,
typedef struct _Alink
{
VOID data;
ULONG size;
struct _Alink *prev;
struct _Alink *next;
}Alink, *pAlink;

Structures are linked with Doubly-Linked-List.

Structure-lists are inserted and deleted frequently.
Search operations are often executed to find specific list(with specific
data), too.
It seems that my driver needs lock to protect structure operation in
multi-cpu environment.
What kind of lock would be proper? And How?

Brief sample code would be a great help to me.
Any answer’ll be great appreciated!

Best regards.
mynam.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Of course, just grab a sample and hack it until it works most/some of the
time. Reading or taking courses is something they don’t have time to do.
After it works some of the time, keep asking questions until someone helps
them get it working a little more of the time. Ship it and find a new job
are probably the next steps. Maybe they were consultants so off on a new
contract with this one as a reference until they discover the problems.
They have to hope they can keep ahead of the bad news. Kind of like the
ponzi scheme, Social Security, and the elected representatives. They figure
they will be out of office long before the suckers discover it is broke.

“Jamey Kirby” wrote in message news:xxxxx@ntdev…

OK, this has to be the most basic question ever asked on this list. Are
newbie’s to damn lazy to read the DDK documents before starting on driver
development?

Doe anyone know how to spell “spinlock”; how about “mutex”?

The kernel provides a plethora of synchronization objects; RTFM.

Jamey Kirby, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]
On Behalf Of mynam
Sent: Thursday, August 14, 2003 2:53 AM
To: Windows System Software Developers Interest List
Subject: [ntdev] Structure Locking.

I’m making a file-system-filter-driver(FSFD).
Many structures are used to store various kind of information.

For example,
typedef struct _Alink
{
VOID data;
ULONG size;
struct _Alink *prev;
struct _Alink *next;
}Alink, *pAlink;

Structures are linked with Doubly-Linked-List.

Structure-lists are inserted and deleted frequently.
Search operations are often executed to find specific list(with specific
data), too.
It seems that my driver needs lock to protect structure operation in
multi-cpu environment.
What kind of lock would be proper? And How?

Brief sample code would be a great help to me.
Any answer’ll be great appreciated!

Best regards.
mynam.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

----- Original Message -----
From: “Jamey Kirby”
To: “Windows System Software Developers Interest List”
Sent: Thursday, August 14, 2003 6:07 PM
Subject: [ntdev] RE: Structure Locking.

> OK, this has to be the most basic question ever asked on this list. Are
> newbie’s to damn lazy to read the DDK documents before starting on driver
> development?
>

Recently , I could read here wihtin a thread, that the DDK documentation was not written for newbie’s :-))))

Mynam,
Using lock on the whole list would kill your performance. You
need to carefully think about the design in these cases. I most of the
time use a reference count and a spinlock/mutex for this kind of
situation.
Lock to protect the integrity of the list, and reference count
to make sure the structure is not deleted while I am accessing it in
some other function.

-Srin.

-----Original Message-----
From: mynam [mailto:xxxxx@netian.com]
Sent: Thursday, August 14, 2003 2:53 AM
To: Windows System Software Developers Interest List
Subject: [ntdev] Structure Locking.

I’m making a file-system-filter-driver(FSFD).
Many structures are used to store various kind of information.

For example,
typedef struct _Alink
{
VOID data;
ULONG size;
struct _Alink *prev;
struct _Alink *next;
}Alink, *pAlink;

Structures are linked with Doubly-Linked-List.

Structure-lists are inserted and deleted frequently.
Search operations are often executed to find specific list(with
specific
data), too.
It seems that my driver needs lock to protect structure operation in
multi-cpu environment.
What kind of lock would be proper? And How?

Brief sample code would be a great help to me.
Any answer’ll be great appreciated!

Best regards.
mynam.


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@nai.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

Maybe for the more obscure APIs and such, but synchronization is well
covered as it is the basic locking mechanism the kernel uses to protect
data.

Jamey Kirby, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

-----Original Message-----
From: xxxxx@lists.osr.com [mailto:xxxxx@lists.osr.com]
On Behalf Of Christiaan Ghijselinck
Sent: Thursday, August 14, 2003 10:53 AM
To: Windows System Software Developers Interest List
Subject: [ntdev] RE: Structure Locking.

----- Original Message -----
From: “Jamey Kirby”
To: “Windows System Software Developers Interest List”
Sent: Thursday, August 14, 2003 6:07 PM
Subject: [ntdev] RE: Structure Locking.

> OK, this has to be the most basic question ever asked on this list. Are
> newbie’s to damn lazy to read the DDK documents before starting on driver
> development?
>

Recently , I could read here wihtin a thread, that the DDK documentation was
not written for newbie’s :-))))


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

You are currently subscribed to ntdev as: xxxxx@storagecraft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com

The DDK documentation is not written for a newbie to read easily as a
tutorial, but I agree with Jamey, people should at least do a seach in the
DDK for a term, before hitting the group for help, especially since the OP
was going to write a file system filter. If he can’t find the basics
himself lord help us when he gets to trying to debug this.

Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting

----- Original Message -----
From: “Christiaan Ghijselinck”
To: “Windows System Software Developers Interest List”
Sent: Thursday, August 14, 2003 1:52 PM
Subject: [ntdev] RE: Structure Locking.

>
> ----- Original Message -----
> From: “Jamey Kirby”
> To: “Windows System Software Developers Interest List”

> Sent: Thursday, August 14, 2003 6:07 PM
> Subject: [ntdev] RE: Structure Locking.
>
>
> > OK, this has to be the most basic question ever asked on this list. Are
> > newbie’s to damn lazy to read the DDK documents before starting on
driver
> > development?
> >
>
>
> Recently , I could read here wihtin a thread, that the DDK documentation
was not written for newbie’s :-))))
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@acm.org
> To unsubscribe send a blank email to xxxxx@lists.osr.com

The question was so basic and elementary is proved he never tried to take a
course or even read a book to see how it is usually done. There are guides
in the DDK that MUST be read before you even start hacking an example. Too
bad there are no good books on file systems and FS filters.

“Christiaan Ghijselinck” wrote in
message news:xxxxx@ntdev…
>
>
> ----- Original Message -----
> From: “Jamey Kirby”
> To: “Windows System Software Developers Interest List”

> Sent: Thursday, August 14, 2003 6:07 PM
> Subject: [ntdev] RE: Structure Locking.
>
>
> > OK, this has to be the most basic question ever asked on this list. Are
> > newbie’s to damn lazy to read the DDK documents before starting on
driver
> > development?
> >
>
>
> Recently , I could read here wihtin a thread, that the DDK documentation
was not written for newbie’s :-))))
>
>
>
>
>