scripts we'll explore those larger server tools in multiplexing servers with select so far we've seen how to handle multiple clients at once with both forked processes and spawned threadsand we've looked at library class that encapsulates both schemes under both approachesall client handlers seem to run in parallel with one another and with the main dispatch loop that continues watching for new incoming requests because all of these tasks run in parallel ( at the same time)the server doesn' get blocked when accepting new requests or when processing long-running client handler technicallythoughthreads and processes don' really run in parallelunless you're lucky enough to have machine with many cpus insteadyour operating system performs juggling act--it divides the computer' processing power among all active tasks it runs part of onethen part of anotherand so on all the tasks appear to run in parallelbut only because the operating system switches focus between tasks so fast that you don' usually notice this process of switching between tasks is sometimes called time-slicing when done by an operating systemit is more generally known as multiplexing when we spawn threads and processeswe rely on the operating system to juggle the active tasks so that none are starved of computing resourcesespecially the main server dispatcher loop howeverthere' no reason that python script can' do so as well for instancea script might divide tasks into multiple steps--run step of one taskthen one of anotherand so onuntil all are completed the script need only know how to divide its attention among the multiple active tasks to multiplex on its own servers can apply this technique to yield yet another way to handle multiple clients at oncea way that requires neither threads nor forks by multiplexing client connections and the main dispatcher with the select system calla single event loop can process multiple clients and accept new ones in parallel (or at least close enough to avoid stallingsuch servers are sometimes called asynchronousbecause they service clients in spurtsas each becomes ready to communicate in asynchronous serversa single main loop run in single process and thread decides which clients should get bit of attention each time through client requests and the main dispatcher loop are each given small slice of the server' attention if they are ready to converse most of the magic behind this server structure is the operating system select callavailable in python' standard select module on all major platforms roughlyselect is asked to monitor list of input sourcesoutput sourcesand exceptional condition sources and tells us which sources are ready for processing it can be made to simply poll all the sources to see which are readywait for maximum time period for sources to become readyor wait indefinitely until one or more sources are ready for processing network scripting