<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Making a Rich Client Smart : Using Multiple Threads</title><link>http://blogs.msdn.com/dphill/pages/183503.aspx</link><description>Another TechEd demo. This time its how to use a ‘task’ pattern to manage asynchronous background tasks and web service requests. This is a variation on my previous article which describes a simplified asynchronous call pattern for Windows Forms applications,</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>How about multicast events?</title><link>http://blogs.msdn.com/dphill/pages/183503.aspx#213507</link><pubDate>Thu, 12 Aug 2004 14:41:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:213507</guid><dc:creator>P. Kim</dc:creator><description>Thank you for the excellent article; this is one of the cleanest design patterns for asynchronous tasks that I have encountered.  However, is it not the case that the Target property of the event returns only the target of the last instance method on the event's invocation list?  If there are multiple threads subscribed to the event, therefore, it is not guaranteed that the event will be fired in a thread-safe manner for all clients, and responsibility for thread safety again devolves to the user interface.</description></item><item><title>re: How about multicast events?</title><link>http://blogs.msdn.com/dphill/pages/183503.aspx#213793</link><pubDate>Thu, 12 Aug 2004 22:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:213793</guid><dc:creator>David Hill</dc:creator><description>The Control.Invoke or BeginInvoke methods ensure that the target of the delegate receives the event on the UI thread. If the delegate happens to be a multicast delegate (ie, a delegate chain) then all targets will be called on the UI thread.&lt;br&gt;&lt;br&gt;It won't matter if the other targets are not Control derived objects. The event will be invoked on the thread of the control on which the Invoke or BeginInvoke method was originally called. In this case, the target will probably not care which thread it is called on because it is not Control derived.&lt;br&gt;&lt;br&gt;Of course, if you needed more control over whether each event was marshalled to the UI thread or not, you could always use the GetInvocationList method of the delegate and fire each one manually, checking for the target's type and handling exception appropriately, etc. You would also have to do this if you had multiple message loops, each on a different thread with controls created on each thread.&lt;br&gt;</description></item></channel></rss>