commonly used network services such as web serveran irc chat servera mail servera relational database interfaceand an object broker although twisted supports processes and threads for longer-running actionsit also uses an asynchronousevent-driven model to handle clientswhich is similar to the event loop of gui libraries like tkinter it abstracts an event loopwhich multiplexes among open socket connectionsautomates many of the details inherent in an asynchronous serverand provides an event-driven framework for scripts to use to accomplish application tasks twisted' internal event engine is similar in spirit to our select-based server and the asyncore modulebut it is regarded as much more advanced twisted is third-party systemnot standard library toolsee its website and documentation for more details summarychoosing server scheme so when should you use select to build serverinstead of threads or forksneeds vary per applicationof coursebut as mentionedservers based on the select call generally perform very well when client transactions are relatively short and are not cpu-bound if they are not shortthreads or forks may be better way to split processing among multiple clients threads and forks are especially useful if clients require long-running processing above and beyond the socket calls used to pass data howevercombinations are possible too--nothing is stopping select-based polling loop from using threadstoo it' important to remember that schemes based on select (and nonblocking socketsare not completely immune to blocking in example - for instancethe send call that echoes text back to client might blocktooand hence stall the entire server we could work around that blocking potential by using select to make sure that the output operation is ready before we attempt it ( use the writesocks list and add another loop to send replies to ready output sockets)albeit at noticeable cost in program clarity in generalthoughif we cannot split up the processing of client' request in such way that it can be multiplexed with other requests and not block the server' main loopselect may not be the best way to construct server by itself while some network servers can satisfy this constraintmany cannot moreoverselect also seems more complex than spawning either processes or threadsbecause we need to manually transfer control among all tasks (for instancecompare the threaded and select versions of our echo servereven without write selectsas usualthoughthe degree of that complexity varies per application the asyncore standard library module mentioned earlier simplifies some of the tasks of implementing select-based event-loop socket serverand twisted offers additional hybrid solutions network scripting