<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Convert Between Synchronous and Asynchronous</title>
	<atom:link href="http://www.csharp411.com/convert-between-synchronous-and-asynchronous/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.csharp411.com/convert-between-synchronous-and-asynchronous/</link>
	<description>C# Development</description>
	<lastBuildDate>Fri, 03 Feb 2012 11:14:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
	<item>
		<title>By: Kaushal Malhotra</title>
		<link>http://www.csharp411.com/convert-between-synchronous-and-asynchronous/#comment-417</link>
		<dc:creator>Kaushal Malhotra</dc:creator>
		<pubDate>Tue, 15 Nov 2011 11:35:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.mini-tools.com/at2/csharp/wordpress/convert-between-synchronous-and-asynchronous/#comment-417</guid>
		<description>Please check out following link for nice post 
 of Asynchronous ans Synchronous...

http://www.mindstick.com/Blog/178/Synchronous%20and%20asynchronous%20command%20execution%20in%20c%20net

Thanks to everyone for your nice article.</description>
		<content:encoded><![CDATA[<p>Please check out following link for nice post<br />
 of Asynchronous ans Synchronous&#8230;</p>
<p><a href="http://www.mindstick.com/Blog/178/Synchronous%20and%20asynchronous%20command%20execution%20in%20c%20net" rel="nofollow">http://www.mindstick.com/Blog/178/Synchronous%20and%20asynchronous%20command%20execution%20in%20c%20net</a></p>
<p>Thanks to everyone for your nice article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: miliu</title>
		<link>http://www.csharp411.com/convert-between-synchronous-and-asynchronous/#comment-416</link>
		<dc:creator>miliu</dc:creator>
		<pubDate>Sat, 01 May 2010 00:19:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.mini-tools.com/at2/csharp/wordpress/convert-between-synchronous-and-asynchronous/#comment-416</guid>
		<description>Thank you very much for the response. My UI updates are more than one (progress update), but your tip gives me some ideas.</description>
		<content:encoded><![CDATA[<p>Thank you very much for the response. My UI updates are more than one (progress update), but your tip gives me some ideas.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: timm</title>
		<link>http://www.csharp411.com/convert-between-synchronous-and-asynchronous/#comment-415</link>
		<dc:creator>timm</dc:creator>
		<pubDate>Fri, 30 Apr 2010 12:36:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.mini-tools.com/at2/csharp/wordpress/convert-between-synchronous-and-asynchronous/#comment-415</guid>
		<description>@miliu: You adeptly answered your own question!  If your async thread calls the main thread to perform a UI update, and your main thread is blocked waiting for the async thread to finish, then you have deadlock.

There is no technical way to break this deadlock.  Your solution requires a redesign.  Here are a couple suggestions:

If your async thread performs only a single UI update when it&#039;s finished, then just pass back the necessary info to the main thread, terminate the async thread, the main thread will unblock, and then you can perform the UI update in the main thread.

If your async thread needs to perform multiple UI updates while the main thread is blocked, then you simply cannot block your main thread.  You&#039;ll have to allow your main thread to continue, and use some other technique such as a bool flag to indicate to the main thread whether the async thread has completed.</description>
		<content:encoded><![CDATA[<p>@miliu: You adeptly answered your own question!  If your async thread calls the main thread to perform a UI update, and your main thread is blocked waiting for the async thread to finish, then you have deadlock.</p>
<p>There is no technical way to break this deadlock.  Your solution requires a redesign.  Here are a couple suggestions:</p>
<p>If your async thread performs only a single UI update when it&#8217;s finished, then just pass back the necessary info to the main thread, terminate the async thread, the main thread will unblock, and then you can perform the UI update in the main thread.</p>
<p>If your async thread needs to perform multiple UI updates while the main thread is blocked, then you simply cannot block your main thread.  You&#8217;ll have to allow your main thread to continue, and use some other technique such as a bool flag to indicate to the main thread whether the async thread has completed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: miliu</title>
		<link>http://www.csharp411.com/convert-between-synchronous-and-asynchronous/#comment-414</link>
		<dc:creator>miliu</dc:creator>
		<pubDate>Fri, 30 Apr 2010 04:15:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.mini-tools.com/at2/csharp/wordpress/convert-between-synchronous-and-asynchronous/#comment-414</guid>
		<description>Thanks for this article. I&#039;m trying to wait for an async call to finish in the main UI thread using your appraoch, but couldn&#039;t make it work. I can make your sample code work. However, once I replace the async function with my code, it stops working. The async function doesn&#039;t execute. I guess the problem is that in my async function, I&#039;m also doing UI update, which is blocked by Signal.WaitOne(). Can you please confirm if this is the problem? If so, do you have any solution? Thanks very much in advance.</description>
		<content:encoded><![CDATA[<p>Thanks for this article. I&#8217;m trying to wait for an async call to finish in the main UI thread using your appraoch, but couldn&#8217;t make it work. I can make your sample code work. However, once I replace the async function with my code, it stops working. The async function doesn&#8217;t execute. I guess the problem is that in my async function, I&#8217;m also doing UI update, which is blocked by Signal.WaitOne(). Can you please confirm if this is the problem? If so, do you have any solution? Thanks very much in advance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John</title>
		<link>http://www.csharp411.com/convert-between-synchronous-and-asynchronous/#comment-413</link>
		<dc:creator>John</dc:creator>
		<pubDate>Mon, 14 Jan 2008 20:53:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.mini-tools.com/at2/csharp/wordpress/convert-between-synchronous-and-asynchronous/#comment-413</guid>
		<description>For a good example of Synchronous and Async calls, use .NET Reflector and look at the System.Net.Sockets.Socket namespace -- the Connect and BeginConnect methods illustrate the method well.</description>
		<content:encoded><![CDATA[<p>For a good example of Synchronous and Async calls, use .NET Reflector and look at the System.Net.Sockets.Socket namespace &#8212; the Connect and BeginConnect methods illustrate the method well.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

