[Tutor] documentation

Magnus Lyckå magnus@thinkware.se
Sun May 25 17:13:02 2003


At 19:13 2003-05-25 +0200, Lennart Middel wrote:
>Hi, I had some trouble finding some documentation about how learn to run 
>two things at a time in a programm. i thought it was called threads. Does 
>anyone have an idea where to find this? You can send your reply to : 
><mailto:Lennart_middel@hotmail.com>Lennart_middel@hotmail.com.
>
>A satishfied python user.

Look here for a start:
http://starship.python.net/crew/aahz/OSCON2001/index.html

It's naturally described in the library reference guide
as well.

It's far from always that threads are the ideal way to do
things though. I think many pythonistas feel that threads
are overused in the Microsoft environment.

Threads mean that you have several things going on at once
in the same memory areas, without the kind of protection you
get when you run your tasks in separate processes. It makes
it both easier to cause bugs, and to find the bugs when they
happen.

Other options are to use several processes, or to serialize
things as far as possible, and try to do things sequentially
instead.

Feel free to tell us what you are really trying to achieve.
After all, "run two things at a time" is hardly a goal in
its own right, but rather something you perceive that you
need to do to reach your real goal. Maybe some other approach
is much smarter?


--
Magnus Lycka (It's really Lyck&aring;), magnus@thinkware.se
Thinkware AB, Sweden, www.thinkware.se
I code Python ~ The shortest path from thought to working program