in reply to Re^2: Problem opening file
in thread Problem opening file

Its as though the arguments I am passing to open aren't being received

I agree, and that's my point.

If very far under the covers, these threads are sharing some common space for performing the atomic openoperation, there could be a race condition where one starts to set up up the parameter block, but before the system call is triggered, another thread goes to update the same block of memory, resulting in invalid parameters being in that space once the service call starts to try to read it.

No doubt one of many possible explanations, but if that's the case, two things come to mind:

  1. A workaround involving retries could buy you a quick and effective, if less than completely graceful, solution, and;
  2. The correct fix, from an engineering perspective, might involve poring over the code for the threads as well as the I/O modules/features to see if there is a prudent place to establish a semaphore or similar gating mechanism to eliminate the race condition.

Replies are listed 'Best First'.
Re^4: Problem opening file
by SimonPratt (Friar) on Jul 10, 2015 at 10:33 UTC

    This suggestion scares the hell out of me, to be honest. You seem to be implying that threads is inherently broken!

    Remember, I'm not using any shared variables at all other than Thread::Queue

      This suggestion scares the hell out of me, to be honest. You seem to be implying that threads is inherently broken!

      Trust me, if they were that broken I would have seen the problem years ago. They aren't, and the above is simply unfounded speculation.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.
      I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!