Doubt on creating threads

koranthala at gmail.com koranthala at gmail.com
Sat Jan 3 11:39:52 EST 2009


I was going through Python posts and this post caught my attention
http://groups.google.com/group/comp.lang.python/browse_thread/thread/f99326a4e5d394e/14cd708956bd1c1a#14cd708956bd1c1a

<quote>
 You have missed an important point. A well designed application does
 neither create so many threads nor processes. The creation of a
thread
 or forking of a process is an expensive operation. You should use a
pool
 of threads or processes.
</unquote>

I am creating an application and it creates ~1-2 threads every second
and kill it within 10 seconds. After reading this I am worried. Is
creating a thread a very costly operation? I cannot use a pool of
threads because I am using an external application (twisted) to create
the threads (deferToThread).



More information about the Python-list mailing list