On Wed, 26 Jul 2006 10:54:48 -0700, Carl J. Van Arsdall wrote: > Alright, based a on discussion on this mailing list, I've started to > wonder, why use threads vs processes.
The debate should not be about "threads vs processes", it should be about "threads vs events". Dr. John Ousterhout (creator of Tcl, Professor of Comp Sci at UC Berkeley, etc), started a famous debate about this 10 years ago with the following simple presentation. http://home.pacbell.net/ouster/threads.pdf That sentiment has largely been ignored and thread usage dominates but, if you have been programming for as long as I have, and have used both thread based architectures AND event/reactor/callback based architectures, then that simple presentation above should ring very true. Problem is, young people merely equate newer == better. On large systems and over time, thread based architectures often tend towards chaos. I have seen a few thread based systems where the programmers become so frustrated with subtle timing issues etc, and they eventually overlay so many mutexes etc, that the implementation becomes single threaded in practice anyhow(!), and very inefficient. BTW, I am fairly new to python but I have seen that the python Twisted framework is a good example of the event/reactor design alternative to threads. See http://twistedmatrix.com/projects/core/documentation/howto/async.html . Douglas Schmidt is a famous designer and author (ACE, Corba Tao, etc) who has written much about reactor design patterns, see "Pattern-Oriented Software Architecture, Vol 2", Wiley 2000, amongst many other references of his. -- http://mail.python.org/mailman/listinfo/python-list