[ = [ = [ = [ = [ = [ = [ = [ = [ = [ = [ = [ = [ = [ = [ = [ = [ = [ = [ = [ = [ = [ = [ = more output omitted main thread exiting if this looks oddit' because it should in factthis demonstrates probably the most unusual aspect of threads what' happening here is that the output of the threads run in parallel is intermixed--because all the threaded function calls run in the same processthey all share the same standard output stream (in python termsthere is just one sys stdout file between themwhich is where printed text is sentthe net effect is that their output can be combined and confused arbitrarily in factthis script' output can differ on each run this jumbling of output grew even more pronounced in python presumably due to its new file output implementation more fundamentallywhen multiple threads can access shared resource like thistheir access must be synchronized to avoid overlap in time--as explained in the next section synchronizing access to shared objects and names one of the nice things about threads is that they automatically come with cross-task communications mechanismobjects and namespaces in process that span the life of threads are shared by all spawned threads for instancebecause every thread runs in the same processif one python thread changes global scope variablethe change can be seen by every other thread in the processmain or child similarlythreads can share and change mutable objects in the process' memory as long as they hold reference to them ( passed-in argumentsthis serves as simple way for program' threads to pass information--exit flagsresult objectsevent indicatorsand so on--back and forth to each other the downside to this scheme is that our threads must sometimes be careful to avoid changing global objects and names at the same time if two threads may change shared object at onceit' not impossible that one of the two changes will be lost (or worsethreads