Python Threading front end
Duncan Grisby
duncan-news at grisby.org
Mon Feb 3 06:10:58 EST 2003
In article <3bebb915.0301311636.21966519 at posting.google.com>,
AJ <ajb128 at hotmail.com> wrote:
>We're having problems with the threading. The program runs on both
>windows and Linux and we're having trouble finding a good, free,
>multi-platform threading library that doesn't clobber our build
>process. The simluation is really easy to make parrallel, we just
>need to run the same function over and over. So my thought is maybe we
>could use python to do the multithreading as well.
You could use Python do control threads in a cross-platform way, but
you'd probably be better off using a C or C++ threading library, since
otherwise you'd expend unnecessary effort calling Python threading
primitives from C++. You might want to look at the omnithread part of
omniORB, which provides a cross-platform C++ threading interface. See
http://omniorb.sourceforge.net/
You can see the omnithread header at
http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/omniorb/omni/include/Attic/omnithread.h?rev=1.21.2.13&only_with_tag=omni4_0_develop
[...]
>Can you "pause" a thread?
Not in a cross-platform way without cooperation from the threads. The
easiest thing is to have the threads you might want to pause check a
flag once in a while, and block on a condition variable if they are
asked to.
Cheers,
Duncan.
--
-- Duncan Grisby --
-- duncan at grisby.org --
-- http://www.grisby.org --
More information about the Python-list
mailing list