Dear Jython list,
Since discovering Jython a few weeks ago, I've had tons of fun coding=20
different stuff. Everything I've wanted to do has so far been pretty=20
easy to work out (Swing, Servlets, SAX, DOM, etc) and super-fun.
The one area in which I'm a little fuzzy is Synchronization. I've=20
managed to subclass java.lang.Thread and the Runnable interface in a=20
the usual ways... and even discovered inner classes in Jython!! (does=20
anyone else do this... can't find it documented). Inner Jython classes=20=
seem to work particularly well with threading when you want to spin off=20=
a new thread quickly (a case when you would probably just do an=20
anonymous inner class in Java).
However, you obviously can't use the synchronized keyword in Jython=20
(right?)... I'd prefer to stick to Java's Threading API as much as=20
possible (just because)... but I guess this is an area where I don't=20
have a choice. Seems like locks and synchronization will have to come=20
from Python...
Can anyone confirm/refute this? Or perhaps provide advice or examples=20
of best-practices for threading and synchronization in this area?
I hear that Python has both the 'thread' and 'threading' modules, and=20
that the later was inspired by Java. I guess what I'm asking for is=20
personal anecdotes of how some of you guys prefer to handle this=20
important area of Jython programming. (I can look up the Python=20
documentation on my own, but I really would like some advice from=20
someone who's walked this road before)
THANKS!!!!
__
Todd Ditchendorf, Web Developer
Email: todd@...
Web=A0 : http://www.ditchnet.org
Cell: (205) 243-9318
|