[Twisted-Python] How to use multi-core CPU in Twisted

Glyph glyph at twistedmatrix.com
Sun Mar 25 21:52:12 EDT 2012


On Mar 25, 2012, at 9:24 PM, Peng Xiao -X (penxiao - Digital China at Cisco) wrote:

> Hi experts
>  
> I want to use multi-core of CPU in twisted for parallel programming.
> Could anyone tell me how to archive that?
> Very thanks.
>  
> Best
> Regards,
>  
> Xiao Peng

There are many different ways, depending on your application.

Generally, some use of spawnProcess is the current best practice.

You might also want to look at a process pool, like <https://launchpad.net/ampoule> to make things a little easier.

Good luck!  This is an area where there are several features in development to make it easier, but it shouldn't be too hard even today. (In the future, we hope that it will eventually be almost automatic.)

-glyph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20120325/c1c51b7f/attachment.htm 


More information about the Twisted-Python mailing list