Home > other >  Python pipe channel colleague whether two channel data
Python pipe channel colleague whether two channel data

Time:09-28

Background: there are three processes, process and process B, there is also A main process, use pipe to process the communication between, when A process or B process after processing the data, the data is sent to the main process, main process as long as it receives one of the two processes have to transmit data, immediately for processing,
But the question now is, and is equipped with two pipes, between A process and main process have A pipe, between B process and main process also had A pipe, but the master how to judge the two pipes one data? Because pipe. The recv () is waiting for it to transfer data to the pipeline, the main process in the diagram below waiting for process pipeline out_pipe2 B to receive the data, but how to judge the process of A process or B pipe also have data? As long as one of the data into the next phase of the operation of the


  • Related