PC Review


Reply
Thread Tools Rate Thread

Control.BeginInvoke(), which thread?

 
 
Grandma Wilkerson
Guest
Posts: n/a
 
      25th Jun 2003
My question concerns the documentation for Control.BeginInvoke(). At one
point is says:

"Executes the specified delegate asynchronously with the specified
arguments, on the thread that the control's underlying handle was created
on."

later in that same documentation page it says...

"Note The BeginInvoke method calls the specified delegate back on a
different thread pool thread. You should not block a thread pool thread for
any length of time."

My impression was that when BeginInvoke is called on a control, the params
are placed on the message queue of the UI thread [which created the control]
and eventually the delegate representing the control's method is called *on
the control's original UI thread*. Why does the documentation mention the
thread pool? Why would a thread pool thread even be involved in this chain
of events? I'm one confused granny.

Granny


 
Reply With Quote
 
 
 
 
Bruce Brown
Guest
Posts: n/a
 
      26th Jun 2003
Hi,

I cannot say anything about the documentation you are reading, but it is
fairly simple.

Control.BeginInvoke() executes the delegate from the UI thread.

BeginInvoke calls on delegates execute the delegate from a thread in the
thread pool. This is a standard asynchronous delegate call.

Regards,

- Bruce.


"Grandma Wilkerson" <(E-Mail Removed)> wrote in message
news:ul%(E-Mail Removed)...
> My question concerns the documentation for Control.BeginInvoke(). At one
> point is says:
>
> "Executes the specified delegate asynchronously with the specified
> arguments, on the thread that the control's underlying handle was created
> on."
>
> later in that same documentation page it says...
>
> "Note The BeginInvoke method calls the specified delegate back on a
> different thread pool thread. You should not block a thread pool thread

for
> any length of time."
>
> My impression was that when BeginInvoke is called on a control, the params
> are placed on the message queue of the UI thread [which created the

control]
> and eventually the delegate representing the control's method is called

*on
> the control's original UI thread*. Why does the documentation mention the
> thread pool? Why would a thread pool thread even be involved in this chain
> of events? I'm one confused granny.
>
> Granny
>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Which mobo? which CPU? which RAM? Is the new system worth it??? padiq75@googlemail.com DIY PC 5 5th Jul 2007 01:05 AM
Which Windows Services can be disabled (which are unnecessary)? Joe Blo Windows XP Performance 2 14th Aug 2004 07:29 PM
which user installed which software? j Windows XP Security 3 26th May 2004 11:14 AM
which processes need to be running and which do not???Any advice or help =?Utf-8?B?Q2hyaXM=?= Windows XP Help 1 6th Mar 2004 12:25 AM
Which patch replaces which Dennis Fleron Windows XP Security 1 3rd Sep 2003 02:54 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:07 PM.