multiprocessing main closing parent process end of connection main done note that data in pipe may become corrupted if two processes try to read from or write to the same end of the pipe at the same time howeverthere is no risk of corruption from processes using different ends of the pipe at the same time sharing state between processes in generalif it can be avoidedthen you should not share state between separate processes howeverif it is unavoidable then the mutiprocessing library provides two ways in which state (datacan be sharedthese are shared memory (as supported by multiprocessing value and multiprocessing arrayand server process process shared memory data can be stored in shared memory map using multiprocessing value or multiprocessing array this data can be accessed by multiple processes the constructor for the multiprocessing value type ismultiprocessing value (typecode_or_type*argslock truewheretypecode_or_type determines the type of the returned objectit is either ctypes type or one character typecode for example'dindicates double precision float and 'iindicates signed integer *args is passed on to the constructor for the type lock if lock is true (the defaultthen new recursive lock object is created to synchronise access to the value if lock is false then access to the returned object will not be automatically protected by lockso it will not necessarily be process-safe the constructor for multiprocessing array is multiprocessing array multiprocessing array(typecode_or_typesize_or_initializerlock=true