From: tiga263 <ome...@gm...> - 2007-04-26 13:50:25
|
There is the same problem on Linux but less frequently I found a solution to bypass all these problems and that works perfectly I use the J2SE 5 java.util.concurrent packages in particular the class java.util.concurrent.atomic.AtomicLong But this that not explain the weakness oj Jython implementation on threading. Hope this help Olivier tiga263 wrote: > > Hello, > > I use the load test tool "The Grinder" release Beta 33 with Jython2.1 and > the threading library to protect a critical section (just an increment). > Here is an extract of my code. > My objective is to increment the self.iccid variable in order to have a > unique identifier between threads > > > from threading import Condition > > class TestRunner: > def __init__(self): > self.cv = Condition() # Used to synchronise thread > activity. > self.iccid=None > self.resourcesObject=None > self.pkg_id=None > self.max_iccid=None > self.firstRun=1 > # Rampup Thread > # >>> sleep <<< > wait_time=grinder.threadID * sleepInitRampup > grinder.sleep(wait_time) > > def __getICCID(self): > # > # Secured multi-threaded ICCID incrementation > # > global ICCID > self.cv.acquire() > try: > self.iccid= str(ICCID) > ICCID+=1 > finally: > self.cv.release() > > When i use Solaris 9, i have threading problems : several threads do not > respect the mutex (I see this with a print of self.iccid) > I use the JVM 1.5_10 > > I have not these problems on a Linux Redhat 4 server - the same code works > perfectly. > What is your advice to investigate this ? > Did your ever saw this kind of problem ? > > Should i do a try with a pure java concurent library instead of python > threading.condition ? > > Thanks, > Olivier > > ------------------------------------------------------------------------- > This SF.net email is sponsored by DB2 Express > Download DB2 Express C - the FREE version of DB2 express and take > control of your XML. No limits. Just data. Click to get it now. > http://sourceforge.net/powerbar/db2/ > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users > > -- View this message in context: http://www.nabble.com/theading-problem-on-Solaris---tf3650653.html#a10200237 Sent from the jython-users mailing list archive at Nabble.com. |