in reply to Re^2: Issue with time() in loop?
in thread Issue with time() in loop?

Basically, your post doesn't contain a testable sample, nor enough information to construct one, nor even enough to relate your perception of a problem with other bug reports. And in their absence, it is hard to see how time() would be failing.

  • Does it always fail, or only occasionally?
  • Have you managed to reproduce the problem in a simple example?
  • If you have, does it still fail if you run the failing code in a non-threaded script?

    In all honestly, it really seems more likely that the socket you are reading from stops receiving because the other end diconnected, or the socket froze, or you are running so many threads that one of them simply didn't get scheduled regularly enough.

    Thinking abstractly, it's possible that there is some buffer somewhere in perl that is used when fetching the time from OS, that might not be completely thread-safe, though I have never seen any similar effect and I've used time() in conjunction with threads a lot. Which OS are you running on?


    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.