in reply to Re^3: Behavior of threads on XP-- system() works, backtic & popen don't...
in thread Behavior of threads on XP-- system() works, backtic & popen don't...

Hokay-- tried it on another machine, also a 2.8GHZ hyperthreading box like the one that initially showed the problem. There however, I installed AS817. Almost the same problem-- got through the System() portion of the first two threads, then hung when on my original system it only got through the first thread's system() portion.

As both of these machines are hyperthreading, I decided to disable hyperthreading on the second machine in the BIOS and try it. Works better, but the very first time I ran it, it hung after the first thread's system(). After that, I wasn't able to get it to hang readily-- it ran fine several times in a row... Seems like a timing problem, so I created a simple .bat file:

:LOOP perl threadtest.pl goto LOOP

and ran it. Ran for a minute or so running the complete test multiple times, then finally hung-- though this time about in the middle of the various tests-- several system/bactic/popen's ran ok then it hangs. This is with hyperthreading disabled.

Appears to be a race or timing problem of some kind, possibly exacerbated by hyperthreading, but apparently not caused by it...

Makes me wonder if system() might also have the problem but less so-- will run some loop tests with just that to see if it will ever hang...

Update: Haven't seen the system() only version hang after looping for quite some time, while not definitive it's still a good sign as far as that is concerned. Also tried the full test on a 1.79GHZ box that doesn't have hyperthreading hardware, and after a dozen or so loops it hangs too. Yet to find a machine it doesn't hang on within a couple dozen loop iterations...

-- Sync
  • Comment on Re^4: Behavior of threads on XP-- system() works, backtic & popen don't...
  • Download Code

Replies are listed 'Best First'.
Re^5: Behavior of threads on XP-- system() works, backtic & popen don't...
by BrowserUk (Patriarch) on Jun 16, 2006 at 12:15 UTC

    I can't reproduce your errors. My feeling is that the errors you are describing are so obvious that they would have been seen and reported long ago if this were a problem with Perl or AS perl. That leads me to conclude that the problem is something to do with your own environment.

    You will need to produce a short script that reliably reproduces the problems for other people before you will be able to take this further.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.
      Well, I don't know what to say at this point-- so far I've tried it on FIVE different machines of various sorts, all XP but both SP1 & SP2, hyperthreading and not, laptops and desktops, Intel & AMD CPUs, from 866MHZ to 2.8GHZ, and they all readily exhibit the problem. I can come up to a machine, install the AS817 .msi with all the default installation options, then open a dos window and run the .bat test loop above and it will hang in short order, sometimes immediately but always within a small number of iterations. I've yet to find a machine where it DOESN'T happen. I'm running out of machines to test it on... -- Sync

        Perhaps if you posted the exact code that you are testing with, rather than a vague description of a vague starting point, then I might see why my attempts to reproduce your code from your descriptions doesn't hang and yours does.


        Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
        Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
        "Science is about questioning the status quo. Questioning authority".
        In the absence of evidence, opinion is indistinguishable from prejudice.
        update Overtaken by OP's additional info in thread above. NO <strike>...</strike> as the observation may tickle a neuron in another monk, someday.
        Given BrowserUK 's yeoman attempts to help you, you might consider that the known, common factor on all five machines is the code you wrote. That, it seems to me, makes it worthwhile to check that code carefully... and to be sure what you showing in your OP is still relevant.