threading, how to?

Sergei Organov osv at javad.com
Fri Apr 21 06:38:14 EDT 2006


"akrapus" <akraps at gmail.com> writes:

> Hi,
>
> I am trying to understand how to use threading in Python. I get
> threading as a concept, but not the implementation.
>
> In order to start threading, do you call it as a separate function,
> which will then be applied to the rest of the code (functions) or do
> you open threading in each function. This all can probably be answered
> by 'How python threads different functions'?

Python doesn't automatically thread anything. Threading in Python is
manual. The idea is that you run your own function in a separate thread
of execution that you create. All the functions that you call from the
mentioned function (and those that they call, etc.) will then run in
those thread of execution.

You can create as many threads (probably up to some limit) as you wish
and call either the same function from them, or different functions,
depending on your application requirements.

-- Sergei.




More information about the Python-list mailing list