Nobody <nob...@nowhere.com> writes: > They also have the advantage that one thread can run while another is > waiting on disk I/O, which isn't something which can be done with a > select/poll interface (even if select/poll worked for files, it doesn't > help for mapped files).
AIO can help with this, but I don't know any language runtimes that use it right now. Really, this (and the similar issue of ram cache misses) is basically why hardware hyperthreading exists too. To get processor parallelism you do have to use OS threads, but green threads are lighter weight and switch faster, so you want to use a combination of both. Basically, use about as many OS threads as you have hardware threads (i.e. CPU cores or hyperthreads), and then assign green threads to OS threads in your application runtime. -- http://mail.python.org/mailman/listinfo/python-list