Ben,

You want to use Java's thread pool support through an executor service. This works very well with Jython, and is discussed in our Jython book, http://jythonpodcast.hostjava.net/jythonbook/en/1.0/Concurrency.html#working-with-tasks

Working with tasks like this integrates well with regular Python code, if at the cost that it mixes in Java. I think that's a reasonable thing to do, the task model is generally a better abstraction than what we get with multiprocessing or threading.

Lastly, porting multiprocessing really doesn't make a lot of sense (although it could certainly be done). Given the JVM footprint, coarse-grain parallelism at the level of processes would seem to be best done in the context of such tools as Hadoop.

- Jim

On Mon, Jul 26, 2010 at 5:12 AM, Benjamin Scherrey <scherrey@proteus-tech.com> wrote:
We've got a webservice that we'd like to deploy on jython that presently uses multiprocessing. This doesn't seem to be available in jython yet. Since jython doesn't have the GIL and apparently handles threading better than CPython, is there a "best practice" method for jython to perform the same functionality? I'd like to avoid reinventing the wheel. Is there a plan/benefit to porting multiprocessing library to jython? It's nice to see jython coming along well with the 2.5 release. Unfortunately the first code I need to port uses libraries not available yet even though it's 100% pure python. I'm willing to work around it but just need some advice as to the best "jythonic" behaviour. :-)

  thanx,

  -- Ben

PS: We also wish we could run tornado under jython. Could epoll be replaced with some asyncore stuff and run?

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users