Multi-Threading in Python

L

Lou

Can anyone tell me how easy it is to do multi-threading in Python?
This has probably been brought up already, so if it has, thanks anyway
 
A

Adam Tauno Williams

Can anyone tell me how easy it is to do multi-threading in Python?

Very easy. Or as easy as in any other platform - and as easy to screw
up. Personally I prefer to use multiprocessing [which is a module that
'simulates' threads using separate processes]. IMO, it is hard to screw
up as you don't get any shared-state for free.
 
G

geremy condra

Can anyone tell me how easy it is to do multi-threading in Python?
This has probably been brought up already, so if it has, thanks anyway

It's very easy, but it's probably best to use multiple processes to take
advantage of multiple cores. Take a look at the threading and
multiprocessing modules.

Geremy Condra
 
T

Terry Reedy

can help to find some examples of multiprocessing

Multiprocessing is designed to be api-compatible with threading.
Search the archives of this list/newsgroup for several examples.
 
A

Adam Tauno Williams

great
can help to find some examples of multiprocessing

There is the reasonably good documentation at:
<http://docs.python.org/library/multiprocessing.html>

I did a Multiprocessing presentation recently:
<http://groups.google.com/group/grpug/web/Multiprocessing.pdf>

And I use multiprocessing in my project; but less than previously as I
now use AMQ for the IPC and multiprocessing only for the process
management.
Subject: Re: Multi-Threading in Python
From: (e-mail address removed)
To: (e-mail address removed)
Date: Tue, 18 May 2010 10:45:11 -0400

Can anyone tell me how easy it is to do multi-threading in Python?

Very easy. Or as easy as in any other platform - and as easy to screw
up. Personally I prefer to use multiprocessing [which is a module that
'simulates' threads using separate processes]. IMO, it is hard to screw
up as you don't get any shared-state for free.
This has probably been brought up already, so if it has, thanks
anyway


______________________________________________________________________
Hotmail: Free, trusted and rich email service. Get it now.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,772
Messages
2,569,593
Members
45,111
Latest member
KetoBurn
Top