<?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"
	>
<channel>
	<title>Comments on: Using Event Gateways for Thread Safe Testing?</title>
	<atom:link href="http://devnulled.com/content/2005/03/using-event-gateways-for-thread-safe-testing/feed/" rel="self" type="application/rss+xml" />
	<link>http://devnulled.com/content/2005/03/using-event-gateways-for-thread-safe-testing/</link>
	<description>devnulled provides news, tips, resources, and articles about various topics that software developers and engineers enjoy.</description>
	<pubDate>Sun, 23 Nov 2008 18:53:35 +0000</pubDate>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>By: Brandon</title>
		<link>http://devnulled.com/content/2005/03/using-event-gateways-for-thread-safe-testing/#comment-1047</link>
		<dc:creator>Brandon</dc:creator>
		<pubDate>Wed, 09 Mar 2005 18:39:06 +0000</pubDate>
		<guid isPermaLink="false">http://devnulled.com/content/2005/03/using-event-gateways-for-thread-safe-testing/#comment-1047</guid>
		<description>Yep, pretty much.  It doesn't always fail though it will leave exceptions in the error log.</description>
		<content:encoded><![CDATA[<p>Yep, pretty much.  It doesn&#8217;t always fail though it will leave exceptions in the error log.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jake</title>
		<link>http://devnulled.com/content/2005/03/using-event-gateways-for-thread-safe-testing/#comment-1046</link>
		<dc:creator>Jake</dc:creator>
		<pubDate>Wed, 09 Mar 2005 18:37:03 +0000</pubDate>
		<guid isPermaLink="false">http://devnulled.com/content/2005/03/using-event-gateways-for-thread-safe-testing/#comment-1046</guid>
		<description>But as far as actually tracking down teh offending method, I assume it's just a matter of where/when the thread fails and then just combing through code...?</description>
		<content:encoded><![CDATA[<p>But as far as actually tracking down teh offending method, I assume it&#8217;s just a matter of where/when the thread fails and then just combing through code&#8230;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon</title>
		<link>http://devnulled.com/content/2005/03/using-event-gateways-for-thread-safe-testing/#comment-1045</link>
		<dc:creator>Brandon</dc:creator>
		<pubDate>Wed, 09 Mar 2005 18:20:39 +0000</pubDate>
		<guid isPermaLink="false">http://devnulled.com/content/2005/03/using-event-gateways-for-thread-safe-testing/#comment-1045</guid>
		<description>I forgot to mention, the way I initially stumble across these isssues is because a given thread doesn't complete successfully, and/or there are errors in the server error log each time I fire off these events.</description>
		<content:encoded><![CDATA[<p>I forgot to mention, the way I initially stumble across these isssues is because a given thread doesn&#8217;t complete successfully, and/or there are errors in the server error log each time I fire off these events.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon</title>
		<link>http://devnulled.com/content/2005/03/using-event-gateways-for-thread-safe-testing/#comment-1044</link>
		<dc:creator>Brandon</dc:creator>
		<pubDate>Wed, 09 Mar 2005 18:18:57 +0000</pubDate>
		<guid isPermaLink="false">http://devnulled.com/content/2005/03/using-event-gateways-for-thread-safe-testing/#comment-1044</guid>
		<description>The way I've come across code which is unsafe via running it through Event Gateways so far has mostly been counter variables which were not properly var'ed.  When a counter is in a shared scope because it has not been var'ed, and is also using the same instance of a component (such as something which has been cached in the server scope), the various threads processing the same type of event will step on each other by incrementing the same counter.  So say the function you're using loops through a list-- since all of the threads are incrementing the same counter variable, you'll end up getting an error such as "&lt;em&gt;In function ListGetAt(list, index [, delimiters]), the value of index, 6, is not a valid as the first argument (this list has 5 elements). Valid indexes are in the range 1 through the number of elements in the list.&lt;/em&gt;"

However this only covers counter variables and not actually checking to make sure that the data returned from a method is not getting hosed-up by thread unsafe coding-- you'd need a way to manually look at each output of a given thread as well as know ahead of time what the expected output from each thread was.  This is where potentially using CFCUnit along with a proper test plan would help out.

Though every time I run across a counter problem, I also look through the rest of the code in a given method to see if I can find any other no-no's as well.</description>
		<content:encoded><![CDATA[<p>The way I&#8217;ve come across code which is unsafe via running it through Event Gateways so far has mostly been counter variables which were not properly var&#8217;ed.  When a counter is in a shared scope because it has not been var&#8217;ed, and is also using the same instance of a component (such as something which has been cached in the server scope), the various threads processing the same type of event will step on each other by incrementing the same counter.  So say the function you&#8217;re using loops through a list&#8211; since all of the threads are incrementing the same counter variable, you&#8217;ll end up getting an error such as &#8220;<em>In function ListGetAt(list, index [, delimiters]), the value of index, 6, is not a valid as the first argument (this list has 5 elements). Valid indexes are in the range 1 through the number of elements in the list.</em>&#8221;</p>
<p>However this only covers counter variables and not actually checking to make sure that the data returned from a method is not getting hosed-up by thread unsafe coding&#8211; you&#8217;d need a way to manually look at each output of a given thread as well as know ahead of time what the expected output from each thread was.  This is where potentially using CFCUnit along with a proper test plan would help out.</p>
<p>Though every time I run across a counter problem, I also look through the rest of the code in a given method to see if I can find any other no-no&#8217;s as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jake</title>
		<link>http://devnulled.com/content/2005/03/using-event-gateways-for-thread-safe-testing/#comment-1042</link>
		<dc:creator>Jake</dc:creator>
		<pubDate>Wed, 09 Mar 2005 14:08:49 +0000</pubDate>
		<guid isPermaLink="false">http://devnulled.com/content/2005/03/using-event-gateways-for-thread-safe-testing/#comment-1042</guid>
		<description>How exactly did you discover which chunks of code weren't thread safe? Did the testing help you track it down somehow or did you just notice "something wrong"?</description>
		<content:encoded><![CDATA[<p>How exactly did you discover which chunks of code weren&#8217;t thread safe? Did the testing help you track it down somehow or did you just notice &#8220;something wrong&#8221;?</p>
]]></content:encoded>
	</item>
</channel>
</rss>
