processes and threading findduplicates- py programand in general it is best to design programs from the ground up with multiprocessing in mind (the program findduplicates- py is provided with the book' examplesit does the same job as findduplicatest py but works in very different way and uses the multiprocessing module another solution being developed is threading-friendly version of the cpython interpretersee www code google com/ /python-threadsafe for the latest project status summary ||this showed how to create programs that can execute other programs using the standard library' subprocess module programs that are run using subprocess can be given command-line datacan be fed data to their standard inputand can have their standard output (and standard errorread using child processes allows us to take maximum advantage of multicore processors and leaves concurrency issues to be handled by the operating system the downside is that if we need to share data or synchronize processes we must devise some kind of communication mechanismfor exampleshared memory ( using the mmap module)shared filesor networkingand this can require care to get right the also showed how to create multithreaded programs unfortunatelysuch programs cannot take full advantage of multiple cores (if run using the standard cpython interpreter)so for pythonusing multiple processes is often more practical solution where performance is concerned nonethelesswe saw that the queue module and python' locking mechanismssuch as threading lockmake threaded programming as straightforward as possible--and that for simple programs that only need to use queue objects like queue queue and queue priorityqueuewe may be able to completely avoid using explicit locks although multithreaded programming is undoubtedly fashionableit can be much more demanding to writemaintainand debug multithreaded programs than single-threaded ones howevermultithreaded programs allow for straightforward communicationfor exampleusing shared data (providing we use queue class or use locking)and make it much easier to synchronize ( to gather resultsthan using child processes threading can also be very useful in gui (graphical user interfaceprograms that must carry out long-running tasks while maintaining responsivenessincluding the ability to cancel the task being worked on but if good communication mechanism between processes is usedsuch as shared memoryor the process-transparent queue offered by the multiprocessing packageusing multiple processes can often be viable alternative to multiple threads