<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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:slash="http://purl.org/rss/1.0/modules/slash/"
	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>Sercan Dağdaş&#039;s Blog</title>
	<atom:link href="http://sercandagdas.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sercandagdas.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Wed, 27 May 2009 06:34:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sercandagdas.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Sercan Dağdaş&#039;s Blog</title>
		<link>http://sercandagdas.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sercandagdas.wordpress.com/osd.xml" title="Sercan Dağdaş&#039;s Blog" />
	<atom:link rel='hub' href='http://sercandagdas.wordpress.com/?pushpress=hub'/>
		<item>
		<title>How to use simple multi-threading in C#.net</title>
		<link>http://sercandagdas.wordpress.com/2009/05/26/how-to-use-simple-multi-threading-in-c-net/</link>
		<comments>http://sercandagdas.wordpress.com/2009/05/26/how-to-use-simple-multi-threading-in-c-net/#comments</comments>
		<pubDate>Tue, 26 May 2009 15:57:42 +0000</pubDate>
		<dc:creator>sercandagdas</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://sercandagdas.wordpress.com/?p=19</guid>
		<description><![CDATA[In this article I will attemp to tell you my experiences programming with threads as a novice. First of all, I really understand that using threads instead of classical one-thread approach is similar to juggling several balls in your hand. There are many challenges awaits : You cannot access windows form components in threads, parameter [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sercandagdas.wordpress.com&amp;blog=7902809&amp;post=19&amp;subd=sercandagdas&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>In this article I will attemp to tell you my experiences programming with threads as a novice.</p>
<p>First of all, I really understand that using threads instead of classical one-thread approach is similar to</p>
<p><span><span style="font-size:x-small;">juggling several balls in your hand. There are many challenges awaits : You cannot access windows form components in threads, parameter passing is somewhat unhandy and sharing variables are nightmares.</span></span></p>
<p><span style="font-size:x-small;">I searched over internet to find valuable information on threads and found a really simplicity without using so much classes and complex implementations like mutex, semphore and monitors.</span></p>
<p><span style="font-size:x-small;">It is hidden in <strong>lock</strong> keyword !</span><br />
<span style="font-size:x-small;">If you do not want your threads in a racing condition simply use <strong>lock</strong> keyword to lock the code inside that block, so only one single thread may access it. The rule of the game is so simple which can be seen in following example :</span><br />
using System.Threading;</p>
<p>&#8230;</p>
<p>private Object dummy;  // our dummy lock variable</p>
<p>int sharedVariable; // so called, trouble shared variable</p>
<p>private void threadFunction() // spawned thread</p>
<p>{</p>
<p>lock (stackLock)<br />
{<br />
sharedVariable++;  // critical se<br />
}</p>
<p>}</p>
<p><!--5b63912e4fe01d4855dcc3704fcc52f7--></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sercandagdas.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sercandagdas.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sercandagdas.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sercandagdas.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sercandagdas.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sercandagdas.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sercandagdas.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sercandagdas.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sercandagdas.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sercandagdas.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sercandagdas.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sercandagdas.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sercandagdas.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sercandagdas.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sercandagdas.wordpress.com&amp;blog=7902809&amp;post=19&amp;subd=sercandagdas&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sercandagdas.wordpress.com/2009/05/26/how-to-use-simple-multi-threading-in-c-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/12c644171624f6e98196ed33c34fba34?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sercandagdas</media:title>
		</media:content>
	</item>
	</channel>
</rss>
