Changes between Initial Version and Version 1 of Ticket #280, comment 5


Ignore:
Timestamp:
Nov 22, 2017, 4:04:56 PM (6 years ago)
Author:
dmik
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #280, comment 5

    initial v1  
    1313}}}
    1414
    15 Now, if Proc1 tries to write to its OUT handle somewhere in between steps 3 and 5, it's likely that we will screw up `DosWrite` the way it happens in multi-threaded Python. Yes, this problem is different from this other case where output loss happens because the process writes to STDOUT which is temporarily redirected to a child's pipe because in this case data is still written to the right pipe (PIPE1 in the example above) even if the other end of the pipe is assigned a different handle in the child. However, I won't be surprised that there are bugs in `DosWrite` that may cause not only crashes but also data loss when it happens while the other end of the pipe is manipulated with `DosDupHandle`. I don't have any proof of that though, only a theoretical thought.
     15Now, if Proc1 tries to write to its OUT handle somewhere in between steps 3 and 5, it's likely that we will screw up `DosWrite` the way it happens in multi-threaded Python. Yes, this problem is different from that other case where output loss happens because the process writes to STDOUT which is temporarily redirected to a child's pipe since in this case data is still written to the right pipe (PIPE1 in the example above) even if the other end of the pipe is assigned a different handle in the child. However, I won't be surprised that there are bugs in `DosWrite` that may cause not only crashes but also data loss when it happens while the other end of the pipe is manipulated with `DosDupHandle`. I don't have any proof of that though, only a theoretical thought.
    1616
    1717In other words, the inter-process case should work in theory but I assume it might not due to bugs in `DosWrite` (which I observe in Python). As opposed to that, the Python case should not work w/o synchronization even in theory because this happens within the same process where file handles are shared between all threads.