PC Review


Reply
Thread Tools Rate Thread

confusing remark in MSDN Control.BeginInvoke() doc

 
 
=?Utf-8?B?Sm9lIERveWxl?=
Guest
Posts: n/a
 
      24th Nov 2004
I've read a bit about the differences between delegate's BeginInvoke and
Control.BeginInvoke, and it sounds like Control's BeginInvoke() ensures that
the delegate is invoked in the thread that created the Control's context.
This implies no thread pool threads are involved. A test app bore this out.

What confuses is me is this note found in
http://msdn.microsoft.com/library/de...oketopic2.asp:

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.

Why does the Control.BeginInvoke() documentation mention thread pool
threads? Are they somehow involved with multi-threaded control programming (I
hope not)? Is it just a doc error? Does the "back" in "calls the specified
delegate back" refer to some other callback delegate that isn't mentioned?
Don't even get me started on the second sentence.

TIA
 
Reply With Quote
 
 
 
 
Jon Skeet [C# MVP]
Guest
Posts: n/a
 
      24th Nov 2004
<=?Utf-8?B?Sm9lIERveWxl?= <Joe (E-Mail Removed)>>
wrote:
> I've read a bit about the differences between delegate's BeginInvoke and
> Control.BeginInvoke, and it sounds like Control's BeginInvoke() ensures that
> the delegate is invoked in the thread that created the Control's context.
> This implies no thread pool threads are involved. A test app bore this out.
>
> What confuses is me is this note found in
> http://msdn.microsoft.com/library/de...ary/en-us/cpre
> f/html/frlrfsystemwindowsformscontrolclassbegininvoketopic2.asp:
>
> 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.
>
> Why does the Control.BeginInvoke() documentation mention thread pool
> threads? Are they somehow involved with multi-threaded control programming (I
> hope not)? Is it just a doc error? Does the "back" in "calls the specified
> delegate back" refer to some other callback delegate that isn't mentioned?
> Don't even get me started on the second sentence.


No, it's just a doc error. I think it's been reported before, but I'll
check so that it should be fixed by the time .NET 2.0 comes out.

--
Jon Skeet - <(E-Mail Removed)>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
 
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
Control.BeginInvoke john doe Microsoft C# .NET 9 12th Jan 2006 02:36 PM
Control.BeginInvoke vs. delegate.BeginInvoke Valerie Hough Microsoft C# .NET 6 21st Oct 2005 12:14 PM
question anbout control.invoke and control.begininvoke C# Microsoft Dot NET Framework Forms 4 24th May 2004 10:45 AM
Control.BeginInvoke(), which thread? Grandma Wilkerson Microsoft Dot NET Framework Forms 1 26th Jun 2003 10:38 AM
Control.BeginInvoke(), which thread? Grandma Wilkerson Microsoft Dot NET 1 26th Jun 2003 10:38 AM


Features
 

Advertising
 

Newsgroups
 


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