<?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: When and How to Use ThreadLocal in Java</title>
	<atom:link href="https://www.tecbar.net/use-threadlocal-java/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.tecbar.net/use-threadlocal-java/</link>
	<description></description>
	<lastBuildDate>Thu, 27 Jul 2017 11:59:57 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.1</generator>
	<item>
		<title>By: santhosh</title>
		<link>https://www.tecbar.net/use-threadlocal-java/#comment-3382</link>
		<dc:creator><![CDATA[santhosh]]></dc:creator>
		<pubDate>Mon, 12 Oct 2015 13:39:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.tecbar.net/?p=586#comment-3382</guid>
		<description><![CDATA[Your post is very nice and easily understandable :)
I have a doubt from your post - &quot;In the example you are explicitly running 3 threads through the run() method with same object. But in real time application, we don&#039;t use explicit threads to run our application. There might be many threads which run to complete a single user request. That means each thread might have some data to be updated to the user session data. But in your example, which ever thread that creates the thread local object has the access to the session object, and only that thread can modify the session data. So what about all other threads that participate to complete the user request. They wont get access to modify the session object..? So how are we resolving this issue.]]></description>
		<content:encoded><![CDATA[<p>Your post is very nice and easily understandable <img src="https://www.tecbar.net/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" /><br />
I have a doubt from your post &#8211; &#8220;In the example you are explicitly running 3 threads through the run() method with same object. But in real time application, we don&#8217;t use explicit threads to run our application. There might be many threads which run to complete a single user request. That means each thread might have some data to be updated to the user session data. But in your example, which ever thread that creates the thread local object has the access to the session object, and only that thread can modify the session data. So what about all other threads that participate to complete the user request. They wont get access to modify the session object..? So how are we resolving this issue.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
