threads and concurrency recv_bytes_into(buffer [offset]receives complete byte message and stores it in the object bufferwhich supports the writable buffer interface ( bytearray object or similaroffset specifies the byte offset into the buffer where to place the message returns the number of bytes received raises buffertooshort if the length of the message exceeds available buffer space send(objsends an object through the connection obj is any object that is compatible with pickle send_bytes(buffer [offset [size]]sends buffer of byte data through the connection buffer is any object that supports the buffer interfaceoffset is the byte offset into the bufferand size is the number of bytes to send the resulting data is sent as single message to be received using single call to recv_bytes(pipes can be used in similar manner as queues here is an example that shows the previous producer-consumer problem implemented using pipesimport multiprocessing consume items on pipe def consumer(pipe)output_pinput_p pipe input_p close(close the input end of the pipe while truetryitem output_p recv(except eoferrorbreak process item print(itemreplace with useful work shutdown print("consumer done"produce items and put on queue sequence is an iterable representing items to be processed def producer(sequenceinput_p)for item in sequenceput the item on the queue input_p send(itemif _name_ =' _main_ '(output_pinput_pmultiprocessing pipe(launch the consumer process cons_p multiprocessing process(target=consumer,args=((output_pinput_p),)cons_p start(close the output pipe in the producer output_p close(produce items sequence [ , , , producer(sequenceinput_psignal completion by closing the input pipe input_p close(wait for the consumer process to shutdown cons_p join( lib fl ff