components such as imported modules are shared among all threads in programif one thread assigns global variablefor instanceits new value will be seen by other threads some care must be taken to control access to shared itemsbut to some this seems generally simpler to use than the process communication tools necessary for forked processeswhich we'll meet later in this and book ( pipesstreamssignalssocketsetc like much in programmingthis is not universally shared viewhoweverso you'll have to weigh the difference for your programs and platforms yourself portability perhaps most important is the fact that threads are more portable than forked processes at this writingos fork is not supported by the standard version of python on windowsbut threads are if you want to run parallel tasks portably in python script today and you are unwilling or unable to install unix-like library such as cygwin on windowsthreads may be your best bet python' thread tools automatically account for any platform-specific thread differencesand they provide consistent interface across all operating systems having said thatthe relatively new multiprocessing module described later in this offers another answer to the process portability issue in some use cases so what' the catchthere are three potential downsides you should be aware of before you start spinning your threadsfunction calls versus programs first of allthreads are not way--at leastnot direct way--to start up another program ratherthreads are designed to run call to function (technicallyany callableincluding bound and unbound methodsin parallel with the rest of the program as we saw in the prior sectionby contrastforked processes can either call function or start new program naturallythe threaded function can run scripts with the exec built-in function and can start new programs with tools such as os systemos popen and the subprocess moduleespecially if doing so is itself long-running task but fundamentallythreads run in-program functions in practicethis is usually not limitation for many applicationsparallel functions are sufficiently powerful for instanceif you want to implement nonblocking input and output and avoid blocking gui or its users with long-running tasksthreads do the jobsimply spawn thread to run function that performs the potentially long-running task the rest of the program will continue independently thread synchronization and queues secondlythe fact that threads share objects and names in global process memory is both good news and bad news--it provides communication mechanismbut we have to be careful to synchronize variety of operations as we'll seeeven operations such as printing are potential conflict since there is only one sys stdout per processwhich is shared by all threads threads