<?xml version="1.0" encoding="windows-1252"?>
<node id="950996" title="Re: panic: COND_DESTROY(6)" created="2012-01-31 10:02:06" updated="2012-01-31 10:02:06">
<type id="11">
note</type>
<author id="647953">
sundialsvc4</author>
<data>
<field name="doctext">
&lt;p&gt;
Addressing now the point &lt;em&gt;of the original poster,&lt;/em&gt; and speaking &lt;em&gt;to&lt;/em&gt; the original poster &lt;u&gt;not&lt;/u&gt; the esteemed monk, BrowserUK, I suggest that enough evidence has been gleaned from the various (useful...) responses to this thread to point the way to sleuthing-out the deficiency in the design of the original program. &amp;nbsp; There &lt;u&gt;is&lt;/u&gt; a timing hole, somewhere, in the &lt;em&gt;application,&lt;/em&gt; and the objective is to &lt;strike&gt;solve the damm thing&lt;/strike&gt; make &lt;em&gt;the application&lt;/em&gt; work properly. &amp;nbsp; (The Perl Gods can do their magic on their own time; meanwhile, one must work with what one has.)
&lt;/p&gt;&lt;p&gt;
In my experience, the most probable cause of such a &amp;ldquo;once in a million&amp;rdquo; issue has to do with the &lt;u&gt;order&lt;/u&gt; in which condition-variables are asserted and released. &amp;nbsp; In much the same way that the Linux kernel stipulates that you must obtain &lt;em&gt;this&lt;/em&gt; lock before you may obtain &lt;em&gt;that&lt;/em&gt; one, the mutual-exclusion controls within the application should be arranged in a definite hierarchy. &amp;nbsp; Each of the alternative paths through the application which employ mutual-exclusion must be hand-examined in this way. &amp;nbsp; Furthermore, if you find yourself releasing one condition and in the very next statements grabbing another one, this practice probably should be avoided: &amp;nbsp; devise some exclusion control that covers both.
&lt;/p&gt;&lt;p&gt;
Mutual exclusion mechanisms cover &lt;em&gt;two&lt;/em&gt; distinct but useful purposes: &amp;nbsp; not only do they regulate simultaneous access to a single atomic resource, but they also and more usefully can be employed to compel programs that need to shuffle between several resources to do that &amp;ldquo;shuffling&amp;rdquo; in only certain selected code-paths and therefore only in a known-in-advance timing sequence. &amp;nbsp; If &lt;i&gt;x&lt;/i&gt; code-paths are manipulating &lt;i&gt;y&lt;/i&gt; resources, then you can wind up with &lt;i&gt;x^y&lt;/i&gt; possible combinations between them, and that&amp;rsquo;s just too many possibilities to manage. &amp;nbsp; Select a handful of reasonable sequences for the work, and oblige the programs who are doing it to grab some kind of semaphore to serialize their passage through it.
&lt;/p&gt;&lt;p&gt;
Even if the mutual-exclusion tools are &amp;ldquo;buried&amp;rdquo; within nice, safe, well-tested (as they certainly are...) &lt;tt&gt;perlguts&lt;/tt&gt;, the essential principle remains: &amp;nbsp; &lt;em&gt;you&lt;/em&gt; have an application to write. &amp;nbsp; Even if some bizzare, not yet found bug still exists in those &amp;ldquo;guts,&amp;rdquo; &lt;em&gt;you&lt;/em&gt; have to devise &lt;em&gt;this&lt;/em&gt; application so as to stay well clear of any of them. &amp;nbsp; HTH.
&lt;/p&gt;</field>
<field name="root_node">
950091</field>
<field name="parent_node">
950091</field>
</data>
</node>
