<?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/"
	>

<channel>
	<title>Java and Me &#187; Concurrency</title>
	<atom:link href="http://rpktech.com/tag/concurrency/feed/" rel="self" type="application/rss+xml" />
	<link>http://rpktech.com</link>
	<description>An Interesting Journey</description>
	<lastBuildDate>Sun, 22 Nov 2015 11:01:05 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.41</generator>
	<item>
		<title>Livelock, Deadlock and Starvation</title>
		<link>http://rpktech.com/2015/02/03/livelock-deadlock-and-starvation/</link>
		<comments>http://rpktech.com/2015/02/03/livelock-deadlock-and-starvation/#comments</comments>
		<pubDate>Tue, 03 Feb 2015 10:08:11 +0000</pubDate>
		<dc:creator><![CDATA[Rahul Kulshreshtha]]></dc:creator>
				<category><![CDATA[Multithreading]]></category>
		<category><![CDATA[Concurrency]]></category>
		<category><![CDATA[Deadlock]]></category>
		<category><![CDATA[Livelock]]></category>
		<category><![CDATA[Lock]]></category>
		<category><![CDATA[Starvation]]></category>

		<guid isPermaLink="false">http://rpktech.com/?p=31</guid>
		<description><![CDATA[I was looking for a good practical\real example of Livelock and I came across a blog of &#8220;Richard&#8221;. He has shown very good examples of livelock, deadlock and starvation. I was more interested to understand livelock example. Here is the]]></description>
				<content:encoded><![CDATA[<p>I was looking for a good practical\real example of Livelock and I came across a blog of &#8220;Richard&#8221;. He has shown very good examples of livelock, deadlock and starvation. I was more interested to understand livelock example. Here is the link to his blog <a title="Richard Blog" href="https://richardbarabe.wordpress.com/2014/02/21/java-deadlock-livelock-and-lock-starvation-examples/" target="_blank">Richard&#8217;s Blog</a>. Few more examples of livelocks can be found <a title="Livelock examples" href="http://stackoverflow.com/questions/1036364/good-example-of-livelock" target="_blank">here</a></p>
<p>After reading <a title="Richard Blog" href="https://richardbarabe.wordpress.com/2014/02/21/java-deadlock-livelock-and-lock-starvation-examples/" target="_blank">Richard&#8217;s Blog</a>, next question came to my mind, how to prevent the live locks or any other lock and if it happened how application should handle that.</p>
<p>I found this solution given by &#8220;Giuseppe Luciano&#8221; which shows a way to solve live lock when it happens in application. Here is his solution &#8211; <a title="A livelock solution" href="http://www.codeproject.com/Articles/278840/A-livelock-solution" target="_blank">A livelock solution</a>. I believe, &#8220;Prevention is better than cure, so first developer should try how to avoid the deadlock situation while designing the solution. I read multiple blogs and googled also for finding the techniques to prevent deadlock, everyone was pointing to &#8220;order of lock acquisition&#8221; but there were 2 blogs who pointed out few more techniques to prevent deadlock and displayed some more situations where deadlock detection may be missed by the developer. These techniques are :</p>
<ol>
<li>Lock Ordering</li>
<li>Lock Timeout</li>
<li>Deadlock Detection</li>
</ol>
<p>You can read more about these techniques on <a href="http://tutorials.jenkov.com/java-concurrency/deadlock-prevention.html" target="_blank">Jenkov&#8217;s website.</a> Another site explained different scenarios which can cause a deadlock, you can find it on <a href="http://www.javaworld.com/article/2075692/java-concurrency/avoid-synchronization-deadlocks.html" target="_blank">Brian Goetz&#8217;s website.</a> It also shows a solution for live lock problem which was discussed in <a title="Richard Blog" href="https://richardbarabe.wordpress.com/2014/02/21/java-deadlock-livelock-and-lock-starvation-examples/" target="_blank">Richard&#8217;s Blog</a>.</p>
<p><a class="a2a_button_facebook" href="http://www.addtoany.com/add_to/facebook?linkurl=http%3A%2F%2Frpktech.com%2F2015%2F02%2F03%2Flivelock-deadlock-and-starvation%2F&amp;linkname=Livelock%2C%20Deadlock%20and%20Starvation" title="Facebook" rel="nofollow" target="_blank"></a><a class="a2a_button_twitter" href="http://www.addtoany.com/add_to/twitter?linkurl=http%3A%2F%2Frpktech.com%2F2015%2F02%2F03%2Flivelock-deadlock-and-starvation%2F&amp;linkname=Livelock%2C%20Deadlock%20and%20Starvation" title="Twitter" rel="nofollow" target="_blank"></a><a class="a2a_button_google_plus" href="http://www.addtoany.com/add_to/google_plus?linkurl=http%3A%2F%2Frpktech.com%2F2015%2F02%2F03%2Flivelock-deadlock-and-starvation%2F&amp;linkname=Livelock%2C%20Deadlock%20and%20Starvation" title="Google+" rel="nofollow" target="_blank"></a><a class="a2a_dd a2a_target addtoany_share_save" href="https://www.addtoany.com/share#url=http%3A%2F%2Frpktech.com%2F2015%2F02%2F03%2Flivelock-deadlock-and-starvation%2F&amp;title=Livelock%2C%20Deadlock%20and%20Starvation" id="wpa2a_2"></a></p>]]></content:encoded>
			<wfw:commentRss>http://rpktech.com/2015/02/03/livelock-deadlock-and-starvation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
