<?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 for javajiggle.com</title>
	<atom:link href="http://javajiggle.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://javajiggle.com</link>
	<description>Java Jiggle. See what's shaking.</description>
	<lastBuildDate>Sat, 07 Jan 2012 09:32:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on Firefox buttons in your JTabbedPane. (Example) by Angelika</title>
		<link>http://javajiggle.com/2007/12/18/firefox-buttons-in-your-jtabbedpane-example/comment-page-1/#comment-15691</link>
		<dc:creator>Angelika</dc:creator>
		<pubDate>Sat, 07 Jan 2012 09:32:24 +0000</pubDate>
		<guid isPermaLink="false">http://javajiggle.com/2007/12/18/firefox-buttons-in-your-jtabbedpane-example/#comment-15691</guid>
		<description>How can I get the content of the textArea (Tab 3 text area) ?</description>
		<content:encoded><![CDATA[<p>How can I get the content of the textArea (Tab 3 text area) ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on JDK 6 Rules!  Adding components to the tabs on JTabbedPane is now a breeze. Check it out! by cedar swing sets</title>
		<link>http://javajiggle.com/2007/11/16/jdk-6-rules-adding-components-to-the-tabs-is-a-breeze-check-it-out/comment-page-1/#comment-15120</link>
		<dc:creator>cedar swing sets</dc:creator>
		<pubDate>Mon, 05 Dec 2011 06:43:59 +0000</pubDate>
		<guid isPermaLink="false">http://javajiggle.com/2007/11/16/jdk-6-rules-adding-components-to-the-tabs-is-a-breeze-check-it-out/#comment-15120</guid>
		<description>&lt;strong&gt;cedar swing sets...&lt;/strong&gt;

[...]JDK 6 Rules! New Components in JTabbedPane are awesome. Use it! &#124; javajiggle.com[...]...</description>
		<content:encoded><![CDATA[<p><strong>cedar swing sets&#8230;</strong></p>
<p>[...]JDK 6 Rules! New Components in JTabbedPane are awesome. Use it! | javajiggle.com[...]&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Math.pow() performance question&#8230; by John Buckwell</title>
		<link>http://javajiggle.com/2009/01/11/mathpow-question/comment-page-1/#comment-14928</link>
		<dc:creator>John Buckwell</dc:creator>
		<pubDate>Thu, 17 Nov 2011 23:12:14 +0000</pubDate>
		<guid isPermaLink="false">http://javajiggle.com/?p=34#comment-14928</guid>
		<description>Just read my comment and seen the cut and paste of the test code didn&#039;t work as intended.  Sorry you will have to write your own code but I stand by the results!</description>
		<content:encoded><![CDATA[<p>Just read my comment and seen the cut and paste of the test code didn&#8217;t work as intended.  Sorry you will have to write your own code but I stand by the results!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Math.pow() performance question&#8230; by John Buckwell</title>
		<link>http://javajiggle.com/2009/01/11/mathpow-question/comment-page-1/#comment-14927</link>
		<dc:creator>John Buckwell</dc:creator>
		<pubDate>Thu, 17 Nov 2011 23:08:38 +0000</pubDate>
		<guid isPermaLink="false">http://javajiggle.com/?p=34#comment-14927</guid>
		<description>Just been coding a processor intensive application that needs to calculate millions of squares so this is an interesting question.  

A simple test for 10 million repetions shows x * x  is 20 - 25 times faster than Math.pow(x, 2.0).  Calling x*x in a method made only marginal difference.

Test code is below.  The purpose of  the &quot;if (r &gt; 200.0) f1 = f2;&quot; statement is to ensure the compile is not optimising the code by inserting the same result for repeated calls to a function with the same parameter values.  It made almost no difference to the run times.

		Date date;
		long startTime;  // in milliseconds
		long endTime;
		double f1 = 15.69;
		double f2 = 17.01;
		double r = 0;
		int cycles = 10000000;
		
		date = new Date();
		startTime = date.getTime();
		for (int i = 0; i  200.0) f1 = f2;
		}
		date = new Date();
		endTime = date.getTime();
		System.out.println(&quot;f * f runtime for &quot;+cycles+&quot; cycles: &quot; + ((endTime - startTime)) + &quot; milliseconds\r&quot;);
		
		date = new Date();
		startTime = date.getTime();
		for (int i = 0; i  200.0) f1 = f2;
		}
		date = new Date();
		endTime = date.getTime();
		System.out.println(&quot;square(f) runtime for &quot;+cycles+&quot; cycles: &quot; + ((endTime - startTime)) + &quot; milliseconds\r&quot;);
		
		date = new Date();
		startTime = date.getTime();
		double two = 2.0;
		for (int i = 0; i  200.0) f1 = f2;
		}
		date = new Date();
		endTime = date.getTime();
		System.out.println(&quot; Math.pow(f1, two) runtime for &quot;+cycles+&quot; cycles: &quot; + ((endTime - startTime)) + &quot; milliseconds\r&quot;);</description>
		<content:encoded><![CDATA[<p>Just been coding a processor intensive application that needs to calculate millions of squares so this is an interesting question.  </p>
<p>A simple test for 10 million repetions shows x * x  is 20 &#8211; 25 times faster than Math.pow(x, 2.0).  Calling x*x in a method made only marginal difference.</p>
<p>Test code is below.  The purpose of  the &#8220;if (r &gt; 200.0) f1 = f2;&#8221; statement is to ensure the compile is not optimising the code by inserting the same result for repeated calls to a function with the same parameter values.  It made almost no difference to the run times.</p>
<p>		Date date;<br />
		long startTime;  // in milliseconds<br />
		long endTime;<br />
		double f1 = 15.69;<br />
		double f2 = 17.01;<br />
		double r = 0;<br />
		int cycles = 10000000;</p>
<p>		date = new Date();<br />
		startTime = date.getTime();<br />
		for (int i = 0; i  200.0) f1 = f2;<br />
		}<br />
		date = new Date();<br />
		endTime = date.getTime();<br />
		System.out.println(&#8220;f * f runtime for &#8220;+cycles+&#8221; cycles: &#8221; + ((endTime &#8211; startTime)) + &#8221; milliseconds\r&#8221;);</p>
<p>		date = new Date();<br />
		startTime = date.getTime();<br />
		for (int i = 0; i  200.0) f1 = f2;<br />
		}<br />
		date = new Date();<br />
		endTime = date.getTime();<br />
		System.out.println(&#8220;square(f) runtime for &#8220;+cycles+&#8221; cycles: &#8221; + ((endTime &#8211; startTime)) + &#8221; milliseconds\r&#8221;);</p>
<p>		date = new Date();<br />
		startTime = date.getTime();<br />
		double two = 2.0;<br />
		for (int i = 0; i  200.0) f1 = f2;<br />
		}<br />
		date = new Date();<br />
		endTime = date.getTime();<br />
		System.out.println(&#8221; Math.pow(f1, two) runtime for &#8220;+cycles+&#8221; cycles: &#8221; + ((endTime &#8211; startTime)) + &#8221; milliseconds\r&#8221;);</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on If JNI based application is crashing, check signal handling! by DLL accessed via JNI terminates App Server running as Windows Service when Logoff of RDP Console &#124; SeekPHP.com</title>
		<link>http://javajiggle.com/2008/01/06/if-jni-based-application-is-crashing-check-signal-handling/comment-page-1/#comment-14564</link>
		<dc:creator>DLL accessed via JNI terminates App Server running as Windows Service when Logoff of RDP Console &#124; SeekPHP.com</dc:creator>
		<pubDate>Wed, 12 Oct 2011 23:01:48 +0000</pubDate>
		<guid isPermaLink="false">http://javajiggle.com/2008/01/06/if-jni-based-application-is-crashing-check-signal-handling/#comment-14564</guid>
		<description>[...] JavaJiggle Article on Signal Handling [...]</description>
		<content:encoded><![CDATA[<p>[...] JavaJiggle Article on Signal Handling [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on If JNI based application is crashing, check signal handling! by DLL accessed via JNI terminates App Server running as Windows Service when Logoff of RDP Console &#124; trouble86.com</title>
		<link>http://javajiggle.com/2008/01/06/if-jni-based-application-is-crashing-check-signal-handling/comment-page-1/#comment-14533</link>
		<dc:creator>DLL accessed via JNI terminates App Server running as Windows Service when Logoff of RDP Console &#124; trouble86.com</dc:creator>
		<pubDate>Sun, 09 Oct 2011 23:18:58 +0000</pubDate>
		<guid isPermaLink="false">http://javajiggle.com/2008/01/06/if-jni-based-application-is-crashing-check-signal-handling/#comment-14533</guid>
		<description>[...] http://javajiggle.com/2008/01/06/if-jni-based-application-is-crashing-check-signal-handling/ [...]</description>
		<content:encoded><![CDATA[<p>[...] <a href="http://javajiggle.com/2008/01/06/if-jni-based-application-is-crashing-check-signal-handling/" rel="nofollow">http://javajiggle.com/2008/01/06/if-jni-based-application-is-crashing-check-signal-handling/</a> [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on If JNI based application is crashing, check signal handling! by raja</title>
		<link>http://javajiggle.com/2008/01/06/if-jni-based-application-is-crashing-check-signal-handling/comment-page-1/#comment-12306</link>
		<dc:creator>raja</dc:creator>
		<pubDate>Tue, 12 Apr 2011 19:14:28 +0000</pubDate>
		<guid isPermaLink="false">http://javajiggle.com/2008/01/06/if-jni-based-application-is-crashing-check-signal-handling/#comment-12306</guid>
		<description>Hi,

what is the use of CheckJni flag?. If we dont set it in our code, then native singals still collide with JVM signals?</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>what is the use of CheckJni flag?. If we dont set it in our code, then native singals still collide with JVM signals?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on If JNI based application is crashing, check signal handling! by javajiggle</title>
		<link>http://javajiggle.com/2008/01/06/if-jni-based-application-is-crashing-check-signal-handling/comment-page-1/#comment-2049</link>
		<dc:creator>javajiggle</dc:creator>
		<pubDate>Wed, 08 Jul 2009 23:58:21 +0000</pubDate>
		<guid isPermaLink="false">http://javajiggle.com/2008/01/06/if-jni-based-application-is-crashing-check-signal-handling/#comment-2049</guid>
		<description>Mehul, 
just got back from my vacation.  Let me try to answer your questions. 
1. signal(SIGINT,mySigHandler) or simply using signal from handler function seems not allowed by g++ compiler … any idea why ? 
&gt; I&#039;m not sure what you mean.   Did you include the signal.h?  see included sample below. 

2. how does signal chaining help for handling native code related issues which can raise signal ? 
&gt;If the native code uses signals and creates the JVM, the JVM will override the signal handler in the native code.   The signal chaining allows JVM to determine whether a raised signal was intended for it.   

I believe that in native code, if two or more libraries use the same signals it is possible that at least one of the signal handlers will be overridden.   Thus signal chaining can be used to ensure that the signals are properly dispatched to the right handlers.    If I&#039;m correct, it can be done by first loading a library that will store signal handlers when libraries register their signal handlers.   It will then dispatch signals to the right signals handlers.   This means that the dispatching library must be loaded first, before libraries that implement signal handlers are loaded.

Here is an example (jsig.c) implementation. 
http://xref.jsecurity.net/openjdk-6/langtools/d3/dae/solaris_2vm_2jsig_8c-source.html

3. can we have more insight on 3rd approach of using LD_PRELOAD? 
&gt;LD_PRELOAD simply specifies libraries that must be loaded before other libraries are loaded.   This avoids a need to link with the library that stores and dispatches to the signal handlers.

Signal example:
-----------------------------------------------
#include &lt;signal.h&gt;
#include &lt;stdio.h&gt;
#include &lt;unistd.h&gt;

void handler( int sig ){
	printf(&quot;signal handler invoked, signal: %d \n&quot;, sig );
}

int main(){
	signal( SIGINT, handler );
	printf(&quot;test SIGINT\n&quot;);
	while( 1 ){
		sleep(1000);
	}
	return 1;
}</description>
		<content:encoded><![CDATA[<p>Mehul,<br />
just got back from my vacation.  Let me try to answer your questions.<br />
1. signal(SIGINT,mySigHandler) or simply using signal from handler function seems not allowed by g++ compiler … any idea why ?<br />
> I&#8217;m not sure what you mean.   Did you include the signal.h?  see included sample below. </p>
<p>2. how does signal chaining help for handling native code related issues which can raise signal ?<br />
>If the native code uses signals and creates the JVM, the JVM will override the signal handler in the native code.   The signal chaining allows JVM to determine whether a raised signal was intended for it.   </p>
<p>I believe that in native code, if two or more libraries use the same signals it is possible that at least one of the signal handlers will be overridden.   Thus signal chaining can be used to ensure that the signals are properly dispatched to the right handlers.    If I&#8217;m correct, it can be done by first loading a library that will store signal handlers when libraries register their signal handlers.   It will then dispatch signals to the right signals handlers.   This means that the dispatching library must be loaded first, before libraries that implement signal handlers are loaded.</p>
<p>Here is an example (jsig.c) implementation.<br />
<a href="http://xref.jsecurity.net/openjdk-6/langtools/d3/dae/solaris_2vm_2jsig_8c-source.html" rel="nofollow">http://xref.jsecurity.net/openjdk-6/langtools/d3/dae/solaris_2vm_2jsig_8c-source.html</a></p>
<p>3. can we have more insight on 3rd approach of using LD_PRELOAD?<br />
>LD_PRELOAD simply specifies libraries that must be loaded before other libraries are loaded.   This avoids a need to link with the library that stores and dispatches to the signal handlers.</p>
<p>Signal example:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
#include <signal .h><br />
#include <stdio .h><br />
#include <unistd .h></p>
<p>void handler( int sig ){<br />
	printf(&#8220;signal handler invoked, signal: %d \n&#8221;, sig );<br />
}</p>
<p>int main(){<br />
	signal( SIGINT, handler );<br />
	printf(&#8220;test SIGINT\n&#8221;);<br />
	while( 1 ){<br />
		sleep(1000);<br />
	}<br />
	return 1;<br />
}</unistd></stdio></signal></p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on If JNI based application is crashing, check signal handling! by David Klassen</title>
		<link>http://javajiggle.com/2008/01/06/if-jni-based-application-is-crashing-check-signal-handling/comment-page-1/#comment-2048</link>
		<dc:creator>David Klassen</dc:creator>
		<pubDate>Wed, 08 Jul 2009 23:47:19 +0000</pubDate>
		<guid isPermaLink="false">http://javajiggle.com/2008/01/06/if-jni-based-application-is-crashing-check-signal-handling/#comment-2048</guid>
		<description>You are a pioneer my friend. Thanks for paving the way to a proof my code is not the culprit of the JVM crash.</description>
		<content:encoded><![CDATA[<p>You are a pioneer my friend. Thanks for paving the way to a proof my code is not the culprit of the JVM crash.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on If JNI based application is crashing, check signal handling! by Mehul Parekh</title>
		<link>http://javajiggle.com/2008/01/06/if-jni-based-application-is-crashing-check-signal-handling/comment-page-1/#comment-1901</link>
		<dc:creator>Mehul Parekh</dc:creator>
		<pubDate>Fri, 03 Jul 2009 05:19:41 +0000</pubDate>
		<guid isPermaLink="false">http://javajiggle.com/2008/01/06/if-jni-based-application-is-crashing-check-signal-handling/#comment-1901</guid>
		<description>3 questions.
1) signal(SIGINT,mySigHandler) or simply using signal from handler function seems not allowed by g++ compiler ... any idea why ?
2) how does signal chaining help for handling native code related issues which can raise signal ?
3) can we have more insight on 3rd approach of using LD_PRELOAD?</description>
		<content:encoded><![CDATA[<p>3 questions.<br />
1) signal(SIGINT,mySigHandler) or simply using signal from handler function seems not allowed by g++ compiler &#8230; any idea why ?<br />
2) how does signal chaining help for handling native code related issues which can raise signal ?<br />
3) can we have more insight on 3rd approach of using LD_PRELOAD?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

