nonarbitrary thread

Hi All:
I read the subject as following
"Never allocate an IRP with IoBuildSynchronousFsdRequest/IoBuildDeviceIoControlRequest in an Arbitrary thread contex "
As a Newbie , I do not understand the definition of nonarbitrary thread .
My understanding is following:
ex: I have a driver do not create any thread by itself, and let assume it
running at thread A
If it is working below IRQL Dispatch level. The thread A will switch back
and forth by context switch .
Does nonarbitrary thread driver mean it can not be interrupt by thread
context switch .
If not , is it mean the driver could sometime run at thread A and
sometime run at thread B. it conflict what I understand. and if it can
happen, then does that mean every driver is always running at arbitrary
thread because It never know it run at which thread.

Could anyone give me a hint on that, or point me to any book or article
which describe this subject.

Thanks

>IoBuildSynchronousFsdRequest/IoBuildDeviceIoControlRequest in an >Arbitrary
thread contex "

“Arbitrary thread context” means “inside some callback from the kernel to
the
driver where kernel does not provide any guarantees of what thread is
current”.
There can also be “user thread context” - means “kernel guarantees that this
is called by the thread which issued the syscall or page fault”.
There can also be “system thread context” - means “kernel guarantees that
this is called by the thread belonging to the system process”.

As about those 2 functions - surely they cannot, they put the IRP on the
list of
all IRPs belonging to the current thread. So, what thread is current is
important for them.

Max

Hi Max:
Thanks for your help, it more clear to me after read your explanation.
you mention that kernel guarantee of what thread is current mean
nonarbirtary thread.
I do not understand how system can guarantee that.
The example which you give (user thread context)

  1. User mode issue I/O request.
  2. I/O mgr create IRP
  3. The dispatch routine of high-level driver receive this IRP
    The dispatch routine of High-level driver can consider it is in
    nonarbirtary thread. However, if the thread switch can happen anytime in 2
    and 3.
    Does not it mean this condition still a arbitrary thread case?

I am clumsy on that, thanks for your patient

Michael Cheng

“Maxim S. Shatskih” @lists.osr.com on 2000/06/07
11:52:53 PM

Please respond to “NT Developers Interest List”

Sent by: xxxxx@lists.osr.com

To: “NT Developers Interest List”
cc:

Subject: [ntdev] Re: nonarbitrary thread

>IoBuildSynchronousFsdRequest/IoBuildDeviceIoControlRequest in an
>Arbitrary
thread contex "

“Arbitrary thread context” means “inside some callback from the kernel to
the
driver where kernel does not provide any guarantees of what thread is
current”.
There can also be “user thread context” - means “kernel guarantees that
this
is called by the thread which issued the syscall or page fault”.
There can also be “system thread context” - means “kernel guarantees that
this is called by the thread belonging to the system process”.

As about those 2 functions - surely they cannot, they put the IRP on the
list of
all IRPs belonging to the current thread. So, what thread is current is
important for them.

Max


You are currently subscribed to ntdev as: xxxxx@logitech.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

> The dispatch routine of High-level driver can consider it is in

nonarbirtary thread. However, if the thread switch can happen anytime in 2
and 3.

And what? Another threads will do their business - and the IRP in question
will be handled by the thread which originated it regardless of the fact
that
preemption is possible.
Arbitrary thread context are DPCs and ISRs - AFAIK only.
PASSIVE_LEVEL callbacks (ExQueueWorkItem etc) are all done from
system thread context.

Max

Hi Maxim:
Thanks , it much more clear to me now. By the way , can you explain what is
meaning of AFAIK.

Regards
Michael Cheng

.

“Maxim S. Shatskih” @lists.osr.com on 2000/06/08
08:42:08 PM

Please respond to “NT Developers Interest List”

Sent by: xxxxx@lists.osr.com

To: “NT Developers Interest List”
cc:

Subject: [ntdev] Re: nonarbitrary thread

> The dispatch routine of High-level driver can consider it is in
> nonarbirtary thread. However, if the thread switch can happen anytime in
2
> and 3.

And what? Another threads will do their business - and the IRP in question
will be handled by the thread which originated it regardless of the fact
that
preemption is possible.
Arbitrary thread context are DPCs and ISRs - AFAIK only.
PASSIVE_LEVEL callbacks (ExQueueWorkItem etc) are all done from
system thread context.

Max


You are currently subscribed to ntdev as: xxxxx@logitech.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

AFAIK and other important 'net terms are documented here:

Any term may be looked up here (great site IMHO):
http://www.tuxedo.org/~esr/jargon/html/The-Jargon-Lexicon.html

BTW, HTH! :slight_smile:

Regards,

Paul Bunn, UltraBac.com, 425-644-6000
Microsoft MVP - WindowsNT/2000
http://www.ultrabac.com

-----Original Message-----
From: xxxxx@logitech.com [mailto:xxxxx@logitech.com]
Sent: Thursday, June 08, 2000 5:53 PM
To: NT Developers Interest List
Subject: [ntdev] Re: nonarbitrary thread

Hi Maxim:
Thanks , it much more clear to me now. By the way , can you explain what is
meaning of AFAIK.

AFAIK = As Far As I Know
IIRC = If I Remember Correctly

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of
xxxxx@logitech.com
Sent: Thursday, June 08, 2000 7:53 PM
To: NT Developers Interest List
Subject: [ntdev] Re: nonarbitrary thread

Hi Maxim:
Thanks , it much more clear to me now. By the way , can you
explain what is
meaning of AFAIK.

Regards
Michael Cheng

.

“Maxim S. Shatskih” @lists.osr.com on 2000/06/08
> 08:42:08 PM
>
> Please respond to “NT Developers Interest List”
>
> Sent by: xxxxx@lists.osr.com
>
>
> To: “NT Developers Interest List”
> cc:
>
> Subject: [ntdev] Re: nonarbitrary thread
>
>
>
> > The dispatch routine of High-level driver can consider it is in
> > nonarbirtary thread. However, if the thread switch can happen anytime in
> 2
> > and 3.
>
> And what? Another threads will do their business - and the IRP in question
> will be handled by the thread which originated it regardless of the fact
> that
> preemption is possible.
> Arbitrary thread context are DPCs and ISRs - AFAIK only.
> PASSIVE_LEVEL callbacks (ExQueueWorkItem etc) are all done from
> system thread context.
>
> Max
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@logitech.com
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>
>
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@pdq.net
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>
>

AFAIK - As Far As I Know
IIRC - If I Remember Correctly
IMHO - It’s My Humble Opinion
LOL - Laughing Out Loud
etc, etc…

----- Original Message -----
From:
To: NT Developers Interest List
Sent: Friday, June 09, 2000 4:53 AM
Subject: [ntdev] Re: nonarbitrary thread

>
> Hi Maxim:
> Thanks , it much more clear to me now. By the way , can you explain what
is
> meaning of AFAIK.
>
> Regards
> Michael Cheng
>
> .
>
>
>
>
> “Maxim S. Shatskih” @lists.osr.com on 2000/06/08
> 08:42:08 PM
>
> Please respond to “NT Developers Interest List”
>
> Sent by: xxxxx@lists.osr.com
>
>
> To: “NT Developers Interest List”
> cc:
>
> Subject: [ntdev] Re: nonarbitrary thread
>
>
>
> > The dispatch routine of High-level driver can consider it is in
> > nonarbirtary thread. However, if the thread switch can happen anytime in
> 2
> > and 3.
>
> And what? Another threads will do their business - and the IRP in question
> will be handled by the thread which originated it regardless of the fact
> that
> preemption is possible.
> Arbitrary thread context are DPCs and ISRs - AFAIK only.
> PASSIVE_LEVEL callbacks (ExQueueWorkItem etc) are all done from
> system thread context.
>
> Max
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@logitech.com
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>
>
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>