and starting "python -ccommand line in the new processwhich runs special python-coded function in this package that reads and unpickles the process and invokes its run method we met pickling briefly in and we will study it further later in this book the implementation is bit more complex than thisand is prone to change over timeof coursebut it' really quite an amazing trick while the portable api generally hides these details from your codeits basic structure can still have subtle impacts on the way you're allowed to use it for instanceon windowsthe main process' logic should generally be nested under __name__ =__main__ test as done here when using this moduleso it can be imported freely by new interpreter without side effects as we'll learn in more detail in unpickling classes and functions requires an import of their enclosing moduleand this is the root of this requirement moreoverwhen globals are accessed in child processes on windowstheir values may not be the same as that in the parent at start timebecause their module will be imported into new process also on windowsall arguments to process must be pickleable because this includes targettargets should be simple functions so they can be pickledthey cannot be bound or unbound object methods and cannot be functions created with lambda see pickle in python' library manual for more on pickleability rulesnearly every object type worksbut callables like functions and classes must be importable--they are pickled by name onlyand later imported to recreate bytecode on windowsobjects with system statesuch as connected socketswon' generally work as arguments to process target eitherbecause they are not pickleable similarlyinstances of custom process subclasses must be pickleable on windows as well this includes all their attribute values objects available in this package ( lock in example - are pickleableand so may be used as both process constructor arguments and subclass attributes ipc objects in this package that appear in later examples like pipe and queue accept only pickleable objectsbecause of their implementation (more on this in the next sectionon unixalthough child process can make use of shared global item created in the parentit' better to pass the object as an argument to the child process' constructorboth for portability to windows and to avoid potential problems if such objects were garbage collected in the parent there are additional rules documented in the library manual in generalthoughif you stick to passing in shared objects to processes and using the synchronization and the multiprocessing module