From: Teresa V. D. <trv...@gm...> - 2007-12-20 04:58:05
|
I saw this pp module (http://www.parallelpython.com/) and as the target platform for my application is an SMP system, I'd like to be able to use it. My current Java based application is multi threaded and my Jython application should be as well. I need to use Jython, because I'm using an API written in Java. How can I make a Jython multi threaded app? thx, Teresa |
From: <ast...@gm...> - 2007-12-20 05:49:29
|
I didn't really look at that parallelpython, but for making jython a multithreaded app, use the threading module. You can read python docs on threads but keep in mind that jython is a bit behind in terms of python's version. Alternatively, you can just import java.lang.Thread directly and jythonize it. from java.lang import Thread class Counter(Thread): def __init__(self): etc.. def run(self): etc.. Regards astigmatik On Dec 20, 2007 12:58 PM, Teresa Van Dusen <trv...@gm...> wrote: > I saw this pp module (http://www.parallelpython.com/) and as the target > platform for my application is an SMP system, I'd like to be able to use it. > > My current Java based application is multi threaded and my Jython > application should be as well. I need to use Jython, because I'm using an > API written in Java. How can I make a Jython multi threaded app? > > thx, > Teresa > |
From: Teresa V. D. <trv...@gm...> - 2007-12-21 12:08:13
|
Thanks for the info. I guess I'll hold on on that right now, because early results of single-threaded runs show that the application in Jython is 3 times slower than its counterpart in Java, As our product is supposed to be a high performance engine, I see little interest in implementing anything in Jython to use it. The only points I could see in favor of using Jython is for the readability of the code, it's typically a lot smaller and less verbose than Java applications and for the fast development. As I'm a newbie in Jython, maybe we can improve things a little if the code is well written, but still, I believe 3 times is a lot of ground to cover in a pure code review. On Dec 19, 2007 11:49 PM, <ast...@gm...> wrote: > I didn't really look at that parallelpython, but for making jython a > multithreaded app, use the threading module. You can read python docs > on threads but keep in mind that jython is a bit behind in terms of > python's version. Alternatively, you can just import java.lang.Thread > directly and jythonize it. > > from java.lang import Thread > class Counter(Thread): > def __init__(self): > etc.. > def run(self): > etc.. > > Regards > astigmatik > > > On Dec 20, 2007 12:58 PM, Teresa Van Dusen <trv...@gm...> wrote: > > I saw this pp module (http://www.parallelpython.com/) and as the target > > platform for my application is an SMP system, I'd like to be able to use > it. > > > > My current Java based application is multi threaded and my Jython > > application should be as well. I need to use Jython, because I'm using > an > > API written in Java. How can I make a Jython multi threaded app? > > > > thx, > > Teresa > > > > ------------------------------------------------------------------------- > SF.Net email is sponsored by: > Check out the new SourceForge.net Marketplace. > It's the best place to buy or sell services > for just about anything Open Source. > > http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > |