On Wed, Aug 30, 2006 at 01:58:03PM +1000, René Dudfield wrote: > changing. The standard thinking is that fork is slow, and that you > should use event driven async for high speed. Well it's not slow if
fork() is actually pretty darned fast due to COW. The problem is that right after that fork() traditionally came an exec() family call which was...not so fast. :-) I worked for a company where we implemented a server in Python (in the 1.5.2 era) and it ran very quickly. All the server's functionality was preloaded by just importing all the function modules we had at startup, and then each request that fork()ed just got handed off to calling the main function in the relevant module. It took a while to start the server (relatively speaking... about a second in wall time) but then the execution image was resident from that time forward and it could dispatch hundreds of requests per second on very modest (even for the time) hardware.