<?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: Rules for good java.util.Timer use</title>
	<atom:link href="http://tech.puredanger.com/index.php/2008/09/22/timer-rules/feed/" rel="self" type="application/rss+xml" />
	<link>http://tech.puredanger.com/2008/09/22/timer-rules/</link>
	<description>Alex Miller&#039;s technical blog</description>
	<lastBuildDate>Mon, 06 Feb 2012 19:39:50 -0800</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
	<item>
		<title>By: Kiran@ Inside Java Virtual Machine</title>
		<link>http://tech.puredanger.com/2008/09/22/timer-rules/comment-page-1/#comment-296099</link>
		<dc:creator>Kiran@ Inside Java Virtual Machine</dc:creator>
		<pubDate>Wed, 25 Jan 2012 09:08:47 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2008/09/22/timer-rules/#comment-296099</guid>
		<description>Timer has limited scheduler functionality compared to quartz scheduler.

Your tips are good for beginners. In real time, 

How do we create a timer as daemon thread.</description>
		<content:encoded><![CDATA[<p>Timer has limited scheduler functionality compared to quartz scheduler.</p>
<p>Your tips are good for beginners. In real time, </p>
<p>How do we create a timer as daemon thread.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: robert</title>
		<link>http://tech.puredanger.com/2008/09/22/timer-rules/comment-page-1/#comment-146316</link>
		<dc:creator>robert</dc:creator>
		<pubDate>Thu, 26 Feb 2009 02:56:41 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2008/09/22/timer-rules/#comment-146316</guid>
		<description>Great tips...

I don&#039;t know if this is the right forum to ask questions,
but, I am taking a simulation course and I was asked to simulate a parking lot, would it be better to use the &lt;b&gt;timer&lt;/b&gt; to trigger each event (which is a random time) of the car (arrival, wait for a ticket, parked time, wait for cashier) or to use &lt;b&gt;&lt;code&gt;ScheduledExecutorService&lt;/code&gt;&lt;/b&gt;, taking into consideration that the maximum number of cars is 1000.

Thanks in advanced,</description>
		<content:encoded><![CDATA[<p>Great tips&#8230;</p>
<p>I don&#8217;t know if this is the right forum to ask questions,<br />
but, I am taking a simulation course and I was asked to simulate a parking lot, would it be better to use the <b>timer</b> to trigger each event (which is a random time) of the car (arrival, wait for a ticket, parked time, wait for cashier) or to use <b><code>ScheduledExecutorService</code></b>, taking into consideration that the maximum number of cars is 1000.</p>
<p>Thanks in advanced,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hamlet D'Arcy</title>
		<link>http://tech.puredanger.com/2008/09/22/timer-rules/comment-page-1/#comment-88797</link>
		<dc:creator>Hamlet D'Arcy</dc:creator>
		<pubDate>Tue, 23 Sep 2008 12:14:57 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2008/09/22/timer-rules/#comment-88797</guid>
		<description>+1 for ScheduledExecutor simply for the exception handling. 

Be aware of the slight differences though... on my platform we observed that a 1 second Timer would post events every 1000 to 1020 ms, while ScheduledExecutor posts every 990-1010 ms. You can imagine what happened when a poor programmer tried to convert the milliseconds to seconds using an integer... 990 / 1000 == 0, dontcha know.</description>
		<content:encoded><![CDATA[<p>+1 for ScheduledExecutor simply for the exception handling. </p>
<p>Be aware of the slight differences though&#8230; on my platform we observed that a 1 second Timer would post events every 1000 to 1020 ms, while ScheduledExecutor posts every 990-1010 ms. You can imagine what happened when a poor programmer tried to convert the milliseconds to seconds using an integer&#8230; 990 / 1000 == 0, dontcha know.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Holger Hoffstätte</title>
		<link>http://tech.puredanger.com/2008/09/22/timer-rules/comment-page-1/#comment-88762</link>
		<dc:creator>Holger Hoffstätte</dc:creator>
		<pubDate>Tue, 23 Sep 2008 09:59:10 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2008/09/22/timer-rules/#comment-88762</guid>
		<description>Agree with Sean - the best way to use Timer is &quot;not&quot;. Unfortunately STPE has its own problems, e.g. fact that the fixed number of threads needs to be determined up front, and that timed event threads are also by themselves worker threads. There is a good intention for this (no unbounded load peaks when too many events fire at once), but usually it is much better to delegate to a real Executor and e.g. coalesce timer overruns for a given task by using a custom TimedRunnable wrapper. Timer cannot be extended easily at all.
I should probably blog about this ;)</description>
		<content:encoded><![CDATA[<p>Agree with Sean &#8211; the best way to use Timer is &#8220;not&#8221;. Unfortunately STPE has its own problems, e.g. fact that the fixed number of threads needs to be determined up front, and that timed event threads are also by themselves worker threads. There is a good intention for this (no unbounded load peaks when too many events fire at once), but usually it is much better to delegate to a real Executor and e.g. coalesce timer overruns for a given task by using a custom TimedRunnable wrapper. Timer cannot be extended easily at all.<br />
I should probably blog about this ;)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Patrick Wright</title>
		<link>http://tech.puredanger.com/2008/09/22/timer-rules/comment-page-1/#comment-88722</link>
		<dc:creator>Patrick Wright</dc:creator>
		<pubDate>Tue, 23 Sep 2008 07:21:48 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2008/09/22/timer-rules/#comment-88722</guid>
		<description>I just set up a cleanup process using the ScheduledExecutorService from java.util.concurrent--I like this better than the old Timer. What do you think? When would you use Timer (outside of being stuck on an old JDK).

Cheers
Patrick</description>
		<content:encoded><![CDATA[<p>I just set up a cleanup process using the ScheduledExecutorService from java.util.concurrent&#8211;I like this better than the old Timer. What do you think? When would you use Timer (outside of being stuck on an old JDK).</p>
<p>Cheers<br />
Patrick</p>
]]></content:encoded>
	</item>
</channel>
</rss>

