put the item on the queue output_q put(itemif _name_ =' _main_ ' multiprocessing queue(launch the consumer process cons_p multiprocessing process(target=consumer,args=( ,)cons_p start(produce items sequence [ , , , producer(sequenceqsignal completion by putting the sentinel on the queue put(nonewait for the consumer process to shutdown cons_p join(if you are using sentinels as shown in this examplebe aware that you will need to put sentinel on the queue for every single consumer for exampleif there were three consumer processes consuming items on the queuethe producer needs to put three sentinels on the queue to get all of the consumers to shut down as an alternative to using queuesa pipe can be used to perform message passing between processes pipe([duplex]creates pipe between processes and returns tuple (conn conn where conn and conn are connection objects representing the ends of the pipe by defaultthe pipe is bidirectional if duplex is set falsethen conn can only be used for receiving and conn can only be used for sending pipe(must be called prior to creating and launching any process objects that use the pipe an instance of connection object returned by pipe(has the following methods and attributesc close(closes the connection called automatically if is garbage collected fileno(returns the integer file descriptor used by the connection poll([timeout]returns true if data is available on the connection timeout specifies the maximum amount of time to wait if omittedthe method returns immediately with result if timeout is set to nonethen the operation will wait indefinitely for data to arrive recv(receives an object sent by send(raises eoferror if the other end of the connection has been closed and there is no more data recv_bytes([maxlength]receives complete byte message sent by send_bytes(maxlength specifies the maximum number of bytes to receive if an incoming message exceeds thisan ioerror is raised and no further reads can be made on the connection raises eoferror if the other end of the connection has been closed and there is no more data lib fl ff