dutche, 21.04.2011 15:19:
Here's the thing...I had to make a program with threads and after
finished, I found some posts and articles in Google about Python and
threads, raising the question about if it really implements thread
programming or not, because of GIL and the way Python needs to lock
some objects.

I have now in my program something about 8 threads and each of them
runs different code based on some directives, these codes relies
sometimes in C api, using classes like zipfile and tarfile, and others
relies only in python code.

What do you mean by "relies sometimes on C api"? Do you mean that it uses binary modules, as opposed to Python modules?


My question is about the efficiency of threads in python, does anybody
has something to share?

From your (rather unspecific) description, I gather that you are doing mostly I/O operations. Threading is an acceptable programming model for that, and Python supports it just fine. The GIL is usually released for I/O operations by the runtime, so if your program is I/O bound, you will get full threading concurrency.

Stefan

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to