I'll bet you anything that the problem you are having with Xpsec is what you suspected perl of doing.

If it works most of the time but only sometimes fails then the most likely problem is that it has troubles with multiple threads and fast CPU's that might actually be able to complete their tasks so fat that the original programmer never expected this to be possible and thus didn't bother to check for this.

One good option would be to find a mailing list for: Xspec and ask if others find the same issues, check to see if there is a new release etc.

For the time being try to do the following in your code:

until ( -e "${tmp}xsfit.dat" ) { bjmsys("xspec - ${tmp}.xcm", $v); } open(DAT, "${tmp}xsfit.dat") || die ("Could not open file!"); my @kT=<DAT>; close DAT;

This will basically make sure that the file exists and only then continue if the file does not exist it will simply try to create is again, and again until the file is there. It is a very crude way of working but it will certainly do the trick.

As long as Xspec does not take for ever and ever before it fails you should be saved until the Xspec problem is resolved.


In reply to Re^3: Runing "regular" code with threaded perl by RatKing
in thread Runing "regular" code with threaded perl by kingskot

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.