Jump-start your project by learning from devs who
write Windows drivers and file systems every day.
Take an OSR seminar!

Upcoming File Systems Related Seminars:
File Systems, Santa Clara, CA 26 October 2010


Go Back   OSR Online Lists > ntfsd
Welcome, Guest
You must login to post to this list
  Message 1 of 6  
21 Sep 00 20:46
ntfsd member 3145
xxxxxx@yahoo.com
Join Date:
Posts To This List: 4
kernel spinlock/executive question

Hi all! Can someone tell me how to atomically drop a spinlock and then contend for executive lock in exclusive mode. I need this cuz I hold the spinlock while searching through a linked list and once match is found I would like to grab the executive resource of the matched node. Dropping spinlock and then grabbing executive can cause someother thread to destroy the node. thanks a bunch! naja __________________________________________________ Do You Yahoo!? Send instant messages & get email alerts with Yahoo! Messenger. http://im.yahoo.com/
  Message 2 of 6  
21 Sep 00 22:20
ntfsd member 2046
xxxxxx@aol.com
Join Date:
Posts To This List: 6
Re: kernel spinlock/executive question

Is there any reason to be spinlock specific? Why dont you use Mutex in place of the spinlock? Raja << Hi all! Can someone tell me how to atomically drop a spinlock and then contend for executive lock in exclusive mode. I need this cuz I hold the spinlock while searching through a linked list and once match is found I would like to grab the executive resource of the matched node. Dropping spinlock and then grabbing executive can cause someother thread to destroy the node. thanks a bunch! naja >>
  Message 3 of 6  
21 Sep 00 22:49
ntfsd member 2316
xxxxxx@hotmail.com
Join Date:
Posts To This List: 18
Re: kernel spinlock/executive question

Whoops.. in place of both the spinlock and eresource. Assign mutexs to the nodes with higher level than the mutex for the list. Since you are using spinlock to protect the list you are not taking advantage of eresource here. > Is there any reason to be spinlock specific? Why dont you use Mutex in place > of the spinlock? > > Raja > > << Hi all! > Can someone tell me how to atomically drop a spinlock and then contend > for executive lock in exclusive mode. I need this cuz I hold the > spinlock while searching through a linked list and once match is found > I would like to grab the executive resource of the matched node. > Dropping spinlock and then grabbing executive can cause someother <...excess quoted lines suppressed...>
  Message 4 of 6  
22 Sep 00 11:33
ntfsd member 2253
xxxxxx@Exchange.Microsoft.com
Join Date:
Posts To This List: 64
Re: kernel spinlock/executive question

True. Note that you are talking normal lock order, not the "level" that seems to be in place for NT kernel mutexes. That has no meaning. If you use primitives, the third parameter to KeSetEvent is actually exactly for the atomic set/wait transition. If TRUE, it will return with the dispatcher held, and you can KeWaitForSingleObject on the next event. -----Original Message----- From: Raja [mailto:xxxxx@hotmail.com] Sent: Thursday, September 21, 2000 7:42 PM To: File Systems Developers Subject: [ntfsd] Re: kernel spinlock/executive question Whoops.. in place of both the spinlock and eresource. Assign mutexs to the nodes with higher level than the mutex for the list. Since you are using spinlock to protect the list you are not taking advantage of eresource here. > Is there any reason to be spinlock specific? Why dont you use Mutex in place > of the spinlock? > > Raja > > << Hi all! > Can someone tell me how to atomically drop a spinlock and then contend > for executive lock in exclusive mode. I need this cuz I hold the > spinlock while searching through a linked list and once match is found > I would like to grab the executive resource of the matched node. > Dropping spinlock and then grabbing executive can cause someother > thread to destroy the node. > > thanks a bunch! > naja >> > > --- > You are currently subscribed to ntfsd as: xxxxx@hotmail.com > To unsubscribe send a blank email to $subst('Email.Unsub') <...excess quoted lines suppressed...> --- You are currently subscribed to ntfsd as: xxxxx@exchange.microsoft.com To unsubscribe send a blank email to $subst('Email.Unsub')
  Message 5 of 6  
22 Sep 00 17:12
ntfsd member 3145
xxxxxx@yahoo.com
Join Date:
Posts To This List: 4
Re: kernel spinlock/executive question

Thanks for the replies. I wasn't clear about my question. I am not holding multiple locks here. I want to drop a spinlock and acquire executive resource atomically. After dropping spinlock; I see the thread can be swapped out. Having dispatcher locked like you mentioned can help me on this I think. But I don't know whether there are APIs exported. thanks naja --- Daniel Lovinger <xxxxx@Exchange.Microsoft.com> wrote: > True. Note that you are talking normal lock order, not the "level" > that > seems to be in place for NT kernel mutexes. That has no meaning. > > If you use primitives, the third parameter to KeSetEvent is actually > exactly for the atomic set/wait transition. If TRUE, it will return > with > the dispatcher held, and you can KeWaitForSingleObject on the next > event. > <...excess quoted lines suppressed...> __________________________________________________ Do You Yahoo!? Send instant messages & get email alerts with Yahoo! Messenger. http://im.yahoo.com/
  Message 6 of 6  
24 Sep 00 17:43
Maxim S. Shatskih
xxxxxx@storagecraft.com
Join Date: 23 Feb 2000
Posts To This List: 3623
Re: kernel spinlock/executive question

> spinlock while searching through a linked list and once match is found > I would like to grab the executive resource of the matched node. > Dropping spinlock and then grabbing executive can cause someother Detach it from the list instead of grabbing the executive lock - this will ensure that no other code will be able to see it. Put it on the list back instead of releasing the executive lock. Max
Posting Rules  
You may not post new threads
You may not post replies
You may not post attachments
You must login to OSR Online AND be a member of the ntfsd list to be able to post.

All times are GMT -5. The time now is 13:50.


Copyright ©2005, OSR Open Systems Resourcs, Inc.
Based on vBulletin Copyright ©2000 - 2005, Jelsoft Enterprises Ltd.
Modified under license