<?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: Java Threading and Signal Handling</title>
	<atom:link href="http://blog.toadhead.net/index.php/2007/03/20/java-threading-and-signal-handling/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.toadhead.net/index.php/2007/03/20/java-threading-and-signal-handling/</link>
	<description>Mike Heath&#039;s Blog</description>
	<lastBuildDate>Thu, 10 Nov 2011 18:05:27 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
	<item>
		<title>By: mheath</title>
		<link>http://blog.toadhead.net/index.php/2007/03/20/java-threading-and-signal-handling/#comment-187</link>
		<dc:creator>mheath</dc:creator>
		<pubDate>Fri, 27 Apr 2007 16:20:14 +0000</pubDate>
		<guid isPermaLink="false">http://swamp.homelinux.net/blog/index.php/2007/03/20/java-threading-and-signal-handling/#comment-187</guid>
		<description>Mark,

It&#039;s not a race condition.  I can see that wait() has been called before notifyAll() gets called.  Also, I didn&#039;t try invoking notifyAll() from the signal handler.  I wouldn&#039;t think this would work since both calls would be coming from the same thread.

I recently came across some very good documentation from Sun called the Java 2 Platform, Standard Edition 5.0: Trouble-Shooting and Diagnostic Guide available at http://java.sun.com/j2se/1.5/pdf/jdk50_ts_guide.pdf.  This guide has a section on signal handling.  Linking the JNI code as prescribed in this documentation improves matters a great deal.  I have yet to test the wait()/notifyAll() issues but once I do I&#039;ll blog about the results.

As far as POSIX AIO and signal handling go in AIOJ, I have it working now but under heavy loads, the signal handler is sometimes unable to obtain a reference to the JNI environment.  I have some ideas on how to fix this and now just need time to test those ideas. :)

-Mike</description>
		<content:encoded><![CDATA[<p>Mark,</p>
<p>It&#8217;s not a race condition.  I can see that wait() has been called before notifyAll() gets called.  Also, I didn&#8217;t try invoking notifyAll() from the signal handler.  I wouldn&#8217;t think this would work since both calls would be coming from the same thread.</p>
<p>I recently came across some very good documentation from Sun called the Java 2 Platform, Standard Edition 5.0: Trouble-Shooting and Diagnostic Guide available at <a href="http://java.sun.com/j2se/1.5/pdf/jdk50_ts_guide.pdf">http://java.sun.com/j2se/1.5/pdf/jdk50_ts_guide.pdf</a>.  This guide has a section on signal handling.  Linking the JNI code as prescribed in this documentation improves matters a great deal.  I have yet to test the wait()/notifyAll() issues but once I do I&#8217;ll blog about the results.</p>
<p>As far as POSIX AIO and signal handling go in AIOJ, I have it working now but under heavy loads, the signal handler is sometimes unable to obtain a reference to the JNI environment.  I have some ideas on how to fix this and now just need time to test those ideas. <img src='http://blog.toadhead.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>-Mike</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Lam</title>
		<link>http://blog.toadhead.net/index.php/2007/03/20/java-threading-and-signal-handling/#comment-186</link>
		<dc:creator>Mark Lam</dc:creator>
		<pubDate>Fri, 27 Apr 2007 14:39:50 +0000</pubDate>
		<guid isPermaLink="false">http://swamp.homelinux.net/blog/index.php/2007/03/20/java-threading-and-signal-handling/#comment-186</guid>
		<description>Could it be a race condition where the notifyAll() gets called before the wait() actually occurs (or is in the midst of being executed)?  Normally, you don&#039;t have the same thread notifying itself.  Hence, the fact that you have to be synchronized on the object before wait() or notifyAll() can be called on it means that you won&#039;t have a race condition.  In this case, with the signal handler being in the same thread, the synchronization doesn&#039;t help.</description>
		<content:encoded><![CDATA[<p>Could it be a race condition where the notifyAll() gets called before the wait() actually occurs (or is in the midst of being executed)?  Normally, you don&#8217;t have the same thread notifying itself.  Hence, the fact that you have to be synchronized on the object before wait() or notifyAll() can be called on it means that you won&#8217;t have a race condition.  In this case, with the signal handler being in the same thread, the synchronization doesn&#8217;t help.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

