<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: .NET Basics &#8211; Do Work in Background Thread to Keep GUI Responsive</title>
	<atom:link href="http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/feed/" rel="self" type="application/rss+xml" />
	<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/</link>
	<description>Learning new software development technologies out loud</description>
	<lastBuildDate>Sat, 11 May 2013 18:53:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
	<item>
		<title>By: Shane</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-2049</link>
		<dc:creator><![CDATA[Shane]]></dc:creator>
		<pubDate>Wed, 20 Feb 2013 21:15:57 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-2049</guid>
		<description><![CDATA[Thanks for the quick response Sean and yes you understand me correctly, except to add that a form button does not directly create the loop. A button does start the process, but the loop starts within an object of another class, that I instantiate from my main form. This object is my work-engine type object...it does a whole load of checking, before looping through a list of &#039;items&#039;.
I&#039;ll come clean; the &#039;items&#039; are software applications that I want to install sequentially. Some are Windows Installer\MSI based, and for this I use a windows installer API DLL that seems to work asynchronously, raising events which are handled in my main form (not my code btw) to update progress bars etc. The remainder are exe based setup routines.
These exe based routines need their own async process...so, I did previously think about placing the entire loop into its own background worker, as you said, but I&#039;d decided that  it would be complicated as I&#039;ll now be calling MSI&#039;s which already run asynchronously, from another asynchronous thread - queue lots of head scratching wondering how the communication back to my main form is done - but perhaps this is not as complicated as I think?
Currently, to get around my issue, I&#039;m resorting to using Process.Start for all non-MSI applications, running theses with a reduced GUI of their own (if they support this natively) and hiding my main form so that a user can&#039;t click on it and discover it&#039;s frozen\busy - not pretty but gets me there.
.Net 4.0 is not allowed in our current environment unfortunately.

I need to do some more reading I think. TBH, I&#039;ve only started coding in the last year so there&#039;s a lot I need to learn.
Once again, thanks for the response.]]></description>
		<content:encoded><![CDATA[<p>Thanks for the quick response Sean and yes you understand me correctly, except to add that a form button does not directly create the loop. A button does start the process, but the loop starts within an object of another class, that I instantiate from my main form. This object is my work-engine type object&#8230;it does a whole load of checking, before looping through a list of &#8216;items&#8217;.<br />
I&#8217;ll come clean; the &#8216;items&#8217; are software applications that I want to install sequentially. Some are Windows Installer\MSI based, and for this I use a windows installer API DLL that seems to work asynchronously, raising events which are handled in my main form (not my code btw) to update progress bars etc. The remainder are exe based setup routines.<br />
These exe based routines need their own async process&#8230;so, I did previously think about placing the entire loop into its own background worker, as you said, but I&#8217;d decided that  it would be complicated as I&#8217;ll now be calling MSI&#8217;s which already run asynchronously, from another asynchronous thread &#8211; queue lots of head scratching wondering how the communication back to my main form is done &#8211; but perhaps this is not as complicated as I think?<br />
Currently, to get around my issue, I&#8217;m resorting to using Process.Start for all non-MSI applications, running theses with a reduced GUI of their own (if they support this natively) and hiding my main form so that a user can&#8217;t click on it and discover it&#8217;s frozen\busy &#8211; not pretty but gets me there.<br />
.Net 4.0 is not allowed in our current environment unfortunately.</p>
<p>I need to do some more reading I think. TBH, I&#8217;ve only started coding in the last year so there&#8217;s a lot I need to learn.<br />
Once again, thanks for the response.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-2047</link>
		<dc:creator><![CDATA[Sean]]></dc:creator>
		<pubDate>Wed, 20 Feb 2013 19:01:14 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-2047</guid>
		<description><![CDATA[Thanks Shane.  If I understand you correctly, you want to have the user click on a button and then work through a loop, doing some action iteratively.  And you want the GUI to not block, but become immediately responsive after they click the button?

I would just put the entire for loop in the BackgroundWorker and then, each time through the loop, do the work you&#039;re doing synchronously, rather than firing up a BackgroundWorker for each iteration.  You&#039;d only do this if you wanted them to run in parallel.

Even better, you should probably look into using async/await keywords, available in .NET 4.5.  (Or .NET 4.0, using Async Targeting Pack).  They simplify the pattern for doing asynchronous work on background threads, even a bit more than the BackgroundWorker.]]></description>
		<content:encoded><![CDATA[<p>Thanks Shane.  If I understand you correctly, you want to have the user click on a button and then work through a loop, doing some action iteratively.  And you want the GUI to not block, but become immediately responsive after they click the button?</p>
<p>I would just put the entire for loop in the BackgroundWorker and then, each time through the loop, do the work you&#8217;re doing synchronously, rather than firing up a BackgroundWorker for each iteration.  You&#8217;d only do this if you wanted them to run in parallel.</p>
<p>Even better, you should probably look into using async/await keywords, available in .NET 4.5.  (Or .NET 4.0, using Async Targeting Pack).  They simplify the pattern for doing asynchronous work on background threads, even a bit more than the BackgroundWorker.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shane</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-2043</link>
		<dc:creator><![CDATA[Shane]]></dc:creator>
		<pubDate>Wed, 20 Feb 2013 13:06:58 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-2043</guid>
		<description><![CDATA[Excellent post. I had to struggle through other backgroundworker tutorials on the web - why couldn&#039;t I have found this one first!

I have a question Sean if you don&#039;t mind - once you fire off a backgroudworker, it does its job asynchronously. As a form button was used to kick start this whole process, control returns to the form which is now free from the time-consuming activities and thus does not freeze. And no other form code is executed until a user clicks on another enabled button etc.

But what if when you click on a button you have a for or while loop, and in this loop you want to call a background worker. But you do NOT want the next loop iteration to execute, until the background worker has completed its first task? Can this be done? i.e. can you somehow pause the next loop iteration while the background worker is doing its thing, but not freeze the main form?]]></description>
		<content:encoded><![CDATA[<p>Excellent post. I had to struggle through other backgroundworker tutorials on the web &#8211; why couldn&#8217;t I have found this one first!</p>
<p>I have a question Sean if you don&#8217;t mind &#8211; once you fire off a backgroudworker, it does its job asynchronously. As a form button was used to kick start this whole process, control returns to the form which is now free from the time-consuming activities and thus does not freeze. And no other form code is executed until a user clicks on another enabled button etc.</p>
<p>But what if when you click on a button you have a for or while loop, and in this loop you want to call a background worker. But you do NOT want the next loop iteration to execute, until the background worker has completed its first task? Can this be done? i.e. can you somehow pause the next loop iteration while the background worker is doing its thing, but not freeze the main form?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: M.S.</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-1963</link>
		<dc:creator><![CDATA[M.S.]]></dc:creator>
		<pubDate>Mon, 19 Nov 2012 18:39:33 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-1963</guid>
		<description><![CDATA[a nice, clearn article about the subject explaining everything in detail. this is hands down the most educative article on threading I&#039;ve seen to date. Even my primary reference book (Pro c# 2008) lacks clarity on the subject and does not explain it in such layman&#039;s terms as this article does. kudos to the author for keeping it simple.]]></description>
		<content:encoded><![CDATA[<p>a nice, clearn article about the subject explaining everything in detail. this is hands down the most educative article on threading I&#8217;ve seen to date. Even my primary reference book (Pro c# 2008) lacks clarity on the subject and does not explain it in such layman&#8217;s terms as this article does. kudos to the author for keeping it simple.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Wawa</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-1888</link>
		<dc:creator><![CDATA[Andy Wawa]]></dc:creator>
		<pubDate>Sat, 13 Oct 2012 19:22:58 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-1888</guid>
		<description><![CDATA[Hi Sean,
the difference is much bigger than just a byte: let&#039;s say I&#039;m reading a Word-Doc (Word 2007), I get: totalBytes=30720 and bytesRead=37098...
Maybe it&#039;s just an academic problem with FileInfo vs. StreamReader, the goal of your tutorial was the function of the BackgroundWorker and after I&#039;ve worked through this, I finally understood.

Andreas]]></description>
		<content:encoded><![CDATA[<p>Hi Sean,<br />
the difference is much bigger than just a byte: let&#8217;s say I&#8217;m reading a Word-Doc (Word 2007), I get: totalBytes=30720 and bytesRead=37098&#8230;<br />
Maybe it&#8217;s just an academic problem with FileInfo vs. StreamReader, the goal of your tutorial was the function of the BackgroundWorker and after I&#8217;ve worked through this, I finally understood.</p>
<p>Andreas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-1887</link>
		<dc:creator><![CDATA[Sean]]></dc:creator>
		<pubDate>Fri, 12 Oct 2012 15:32:34 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-1887</guid>
		<description><![CDATA[Hmm, interesting.  What is bytesRead at that point, vs. totalBytes?  Just 1 byte too many?  You could also comment out the pctComplete stuff and let the loop complete (read until ReadLine returns null) to see how many bytes the StreamReader is telling you it read.  Is it just a byte or two beyond what FileInfo said was in the file?  Or is it much higher?  Perhaps there&#039;s a problem in my logic related to assumptions about encoding, i.e. FileInfo vs. StreamReader]]></description>
		<content:encoded><![CDATA[<p>Hmm, interesting.  What is bytesRead at that point, vs. totalBytes?  Just 1 byte too many?  You could also comment out the pctComplete stuff and let the loop complete (read until ReadLine returns null) to see how many bytes the StreamReader is telling you it read.  Is it just a byte or two beyond what FileInfo said was in the file?  Or is it much higher?  Perhaps there&#8217;s a problem in my logic related to assumptions about encoding, i.e. FileInfo vs. StreamReader</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andy Wawa</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-1886</link>
		<dc:creator><![CDATA[Andy Wawa]]></dc:creator>
		<pubDate>Fri, 12 Oct 2012 13:04:10 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-1886</guid>
		<description><![CDATA[Hi Sean,
as I already said, an excellent article!
Still there is something I don&#039;t quite understand: while reading a &quot;simple&quot; text file it all works fine. But reading a Word-Doc I get an ArgumentOutOfRangeException saying, that the value 
(ReadTheFile class): int pctComplete = (int)(((double)bytesRead / (double)totalBytes)*100); &gt; 101 % is!
It means, that bytesRead &gt; totalBytes..(and it really is).
Does the programm count some hidden characters?

Andreas]]></description>
		<content:encoded><![CDATA[<p>Hi Sean,<br />
as I already said, an excellent article!<br />
Still there is something I don&#8217;t quite understand: while reading a &#8220;simple&#8221; text file it all works fine. But reading a Word-Doc I get an ArgumentOutOfRangeException saying, that the value<br />
(ReadTheFile class): int pctComplete = (int)(((double)bytesRead / (double)totalBytes)*100); &gt; 101 % is!<br />
It means, that bytesRead &gt; totalBytes..(and it really is).<br />
Does the programm count some hidden characters?</p>
<p>Andreas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-1885</link>
		<dc:creator><![CDATA[Sean]]></dc:creator>
		<pubDate>Thu, 11 Oct 2012 01:58:18 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-1885</guid>
		<description><![CDATA[That should be fine.  If the thread is terminating, likely it&#039;s throwing an exception.]]></description>
		<content:encoded><![CDATA[<p>That should be fine.  If the thread is terminating, likely it&#8217;s throwing an exception.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steven</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-1884</link>
		<dc:creator><![CDATA[Steven]]></dc:creator>
		<pubDate>Thu, 11 Oct 2012 01:53:33 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-1884</guid>
		<description><![CDATA[Have you ever tried setting up a TCP/IP client in a Background Worker.  It seems that if I spend too long processing data coming in, the thread terminates prematurely.]]></description>
		<content:encoded><![CDATA[<p>Have you ever tried setting up a TCP/IP client in a Background Worker.  It seems that if I spend too long processing data coming in, the thread terminates prematurely.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Background thread &#124; Bigappletowing</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-1843</link>
		<dc:creator><![CDATA[Background thread &#124; Bigappletowing]]></dc:creator>
		<pubDate>Thu, 03 May 2012 06:35:48 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-1843</guid>
		<description><![CDATA[[...] .NET Basics &#8211; Do Work in Background Thread to Keep GUI &#8230;May 21, 2009 &#8230; A well designed application, on the other hand, is one that is careful to do as much work as possible in background threads, keeping the GUI &#8230; [...]]]></description>
		<content:encoded><![CDATA[<p>[...] .NET Basics &#8211; Do Work in Background Thread to Keep GUI &#8230;May 21, 2009 &#8230; A well designed application, on the other hand, is one that is careful to do as much work as possible in background threads, keeping the GUI &#8230; [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-1772</link>
		<dc:creator><![CDATA[Sean]]></dc:creator>
		<pubDate>Wed, 21 Dec 2011 13:44:45 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-1772</guid>
		<description><![CDATA[Take a look at - http://www.albahari.com/threading/ for a good intro to threading.]]></description>
		<content:encoded><![CDATA[<p>Take a look at &#8211; <a href="http://www.albahari.com/threading/" rel="nofollow">http://www.albahari.com/threading/</a> for a good intro to threading.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: hollidevil</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-1771</link>
		<dc:creator><![CDATA[hollidevil]]></dc:creator>
		<pubDate>Wed, 21 Dec 2011 07:12:07 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-1771</guid>
		<description><![CDATA[Excellent work...can you provide links where I could study in depth about Threads and their types and all..
Thanks]]></description>
		<content:encoded><![CDATA[<p>Excellent work&#8230;can you provide links where I could study in depth about Threads and their types and all..<br />
Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: &#187; Suplanus</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-1753</link>
		<dc:creator><![CDATA[&#187; Suplanus]]></dc:creator>
		<pubDate>Fri, 07 Oct 2011 17:30:22 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-1753</guid>
		<description><![CDATA[[...] Quelle: stuff.seans.com      Drucken [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Quelle: stuff.seans.com      Drucken [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gold Post</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-1707</link>
		<dc:creator><![CDATA[Gold Post]]></dc:creator>
		<pubDate>Fri, 01 Jul 2011 01:23:33 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-1707</guid>
		<description><![CDATA[Andreas,
It is not a good idea to use he finally block for normal code execution. Exceptions are for errors. Also, when an exception is thrown, the performance of the app stinks.

Sean,
Great article!]]></description>
		<content:encoded><![CDATA[<p>Andreas,<br />
It is not a good idea to use he finally block for normal code execution. Exceptions are for errors. Also, when an exception is thrown, the performance of the app stinks.</p>
<p>Sean,<br />
Great article!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andreas Wawa</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-1697</link>
		<dc:creator><![CDATA[Andreas Wawa]]></dc:creator>
		<pubDate>Thu, 26 May 2011 11:59:15 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-1697</guid>
		<description><![CDATA[Thanks Sean for your excellent work!!
Simply put: when I&#039;ve a button fireing several Methods in row(gathering infos, copying files (some 2 GB, i takes time..), installing, doSomeScripts, another_install etc.) and EVERY single method MUST wait for previous one to be acomplished (there is no point in installing when the files still are not copied!) all what I need to do, is just put then next method (say after copying the next one is installing()) in finally-block of  &quot;bgWorker_RunWorkerCompleted&quot; method??
Andreas]]></description>
		<content:encoded><![CDATA[<p>Thanks Sean for your excellent work!!<br />
Simply put: when I&#8217;ve a button fireing several Methods in row(gathering infos, copying files (some 2 GB, i takes time..), installing, doSomeScripts, another_install etc.) and EVERY single method MUST wait for previous one to be acomplished (there is no point in installing when the files still are not copied!) all what I need to do, is just put then next method (say after copying the next one is installing()) in finally-block of  &#8220;bgWorker_RunWorkerCompleted&#8221; method??<br />
Andreas</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ram</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-827</link>
		<dc:creator><![CDATA[Ram]]></dc:creator>
		<pubDate>Tue, 08 Mar 2011 18:15:38 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-827</guid>
		<description><![CDATA[I agree with all of the other poster&#039;s comments - this is by far the best threading tutorial dealing with unresponsive UI that google search could bring up. I waded through several links but persistence paid of and found this gem that you have created on the second page full of links!
I am trying to build a Windows front end that captures sensor data via Ethernet/UDP and display it dynamically in a GUI, and I am confident that the knowledge gained from your article will help me greatly. Thank You!]]></description>
		<content:encoded><![CDATA[<p>I agree with all of the other poster&#8217;s comments &#8211; this is by far the best threading tutorial dealing with unresponsive UI that google search could bring up. I waded through several links but persistence paid of and found this gem that you have created on the second page full of links!<br />
I am trying to build a Windows front end that captures sensor data via Ethernet/UDP and display it dynamically in a GUI, and I am confident that the knowledge gained from your article will help me greatly. Thank You!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Albert</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-422</link>
		<dc:creator><![CDATA[Albert]]></dc:creator>
		<pubDate>Wed, 30 Sep 2009 17:56:08 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-422</guid>
		<description><![CDATA[p.s.s. also i&#039;m doing something funkier with the _ProgressChanged(object sender, ProgressChangedEventArgs e) function:

the ProgressChangedEventArgs e object has a property called e.UserState which is an object. 

I&#039;m using this backgroundworker in an app where I am sending an Image to a ListView for display as it finds the Images on disk. So I am actually passing the Image object to the ProgressChanged handler by passing the Image as a (object) through the e.UserState ! 

then my progresschanged handler function casts it back to (Image) and adds it to the ListView.LargeImageList

and it works! and it works pretty fast too! so just a tip since e.UserState is an (object) you could pass almost anything through it and cast it back at the UI thread&#039;s handler function.]]></description>
		<content:encoded><![CDATA[<p>p.s.s. also i&#8217;m doing something funkier with the _ProgressChanged(object sender, ProgressChangedEventArgs e) function:</p>
<p>the ProgressChangedEventArgs e object has a property called e.UserState which is an object. </p>
<p>I&#8217;m using this backgroundworker in an app where I am sending an Image to a ListView for display as it finds the Images on disk. So I am actually passing the Image object to the ProgressChanged handler by passing the Image as a (object) through the e.UserState ! </p>
<p>then my progresschanged handler function casts it back to (Image) and adds it to the ListView.LargeImageList</p>
<p>and it works! and it works pretty fast too! so just a tip since e.UserState is an (object) you could pass almost anything through it and cast it back at the UI thread&#8217;s handler function.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-421</link>
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Wed, 30 Sep 2009 15:43:32 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-421</guid>
		<description><![CDATA[Thanks Sean, I had always been aware of doing things in a background thread being a good practice with windows forms but was daunted by the idea of turning an otherwise simple app multi-threaded.  Thanks to your examples I don&#039;t have to be further disgusted by my overuse of application.doevents(). Much appreciated!]]></description>
		<content:encoded><![CDATA[<p>Thanks Sean, I had always been aware of doing things in a background thread being a good practice with windows forms but was daunted by the idea of turning an otherwise simple app multi-threaded.  Thanks to your examples I don&#8217;t have to be further disgusted by my overuse of application.doevents(). Much appreciated!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-420</link>
		<dc:creator><![CDATA[Sean]]></dc:creator>
		<pubDate>Thu, 24 Sep 2009 22:15:23 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-420</guid>
		<description><![CDATA[Thanks Albert.  Good question (why).  My quick guess is that the underlying Win32 controls are not thread-safe, so we have to appoint a single thread to do all of the updates.  But I&#039;d like to dig a little bit deeper to also understand the lower-level aspects of what&#039;s going on.  Stay tuned--sounds like a good topics for a future post.]]></description>
		<content:encoded><![CDATA[<p>Thanks Albert.  Good question (why).  My quick guess is that the underlying Win32 controls are not thread-safe, so we have to appoint a single thread to do all of the updates.  But I&#8217;d like to dig a little bit deeper to also understand the lower-level aspects of what&#8217;s going on.  Stay tuned&#8211;sounds like a good topics for a future post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: albert</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-419</link>
		<dc:creator><![CDATA[albert]]></dc:creator>
		<pubDate>Thu, 24 Sep 2009 21:42:31 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-419</guid>
		<description><![CDATA[This is the best UI multithreading tutorial on the web I have found yet. Everyone else&#039;s tutorial is horrible. This one here is the most concise, most descriptive, most easily understandable. I feel like all the other tutorials are just copying off eachother and no one knows how to explain it well. Thanks for writing one that finally explains it well.

P.S. No one has explained *why* a form control can never be updated from outside the UI thread. Why can that never happen? Is it just a security measure .net has to prevent controls from being manipulated by viruses or other programs?]]></description>
		<content:encoded><![CDATA[<p>This is the best UI multithreading tutorial on the web I have found yet. Everyone else&#8217;s tutorial is horrible. This one here is the most concise, most descriptive, most easily understandable. I feel like all the other tutorials are just copying off eachother and no one knows how to explain it well. Thanks for writing one that finally explains it well.</p>
<p>P.S. No one has explained *why* a form control can never be updated from outside the UI thread. Why can that never happen? Is it just a security measure .net has to prevent controls from being manipulated by viruses or other programs?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dirk</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-391</link>
		<dc:creator><![CDATA[Dirk]]></dc:creator>
		<pubDate>Fri, 24 Jul 2009 12:24:11 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-391</guid>
		<description><![CDATA[Thanks mate!]]></description>
		<content:encoded><![CDATA[<p>Thanks mate!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Batul</title>
		<link>http://stuff.seans.com/2009/05/21/net-basics-do-work-in-background-thread-to-keep-gui-responsive/#comment-375</link>
		<dc:creator><![CDATA[Batul]]></dc:creator>
		<pubDate>Thu, 25 Jun 2009 15:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://stuff.seans.com/?p=893#comment-375</guid>
		<description><![CDATA[Thanks a lot. This post is really useful. I started as a novice in threading... but got my application working. Many many thanks.]]></description>
		<content:encoded><![CDATA[<p>Thanks a lot. This post is really useful. I started as a novice in threading&#8230; but got my application working. Many many thanks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
