Re: Read-Write Lock vs primitive Lock()

2008-12-30 Thread Gabriel Genellina
En Tue, 30 Dec 2008 06:16:23 -0200, k3xji escribió: As GLOBAL_LOOP_COUNT is 1000, now this is making a bottleneck on the readers. I had assumed that as everythread is given only 100 bytecodes to execute, that it will be enough to have a 1 value for this number to let other rthread start

Re: Read-Write Lock vs primitive Lock()

2008-12-30 Thread k3xji
> >> Note that the thread acquires the lock ONCE, repeats several thousand > >> times an assignment to a *local* variable called GLOBAL_VAR (!), finally > >> releases the lock and exits. As every thread does the same, they just   > >> run > >> one after another, they never have a significant overl

Re: Read-Write Lock vs primitive Lock()

2008-12-30 Thread k3xji
> >> Note that the thread acquires the lock ONCE, repeats several thousand > >> times an assignment to a *local* variable called GLOBAL_VAR (!), finally > >> releases the lock and exits. As every thread does the same, they just   > >> run > >> one after another, they never have a significant overl

Re: Read-Write Lock vs primitive Lock()

2008-12-29 Thread Gabriel Genellina
En Mon, 29 Dec 2008 08:17:42 -0200, k3xji escribió: On 29 Aralık, 11:52, "Gabriel Genellina" wrote: En Mon, 29 Dec 2008 05:56:10 -0200, k3xji escribió: > I  am trying to see on which situations does the Read-Write Lock > performs better on primitive Lock() itself. Below is the code I am > u

Re: Read-Write Lock vs primitive Lock()

2008-12-29 Thread Aaron Brady
On Dec 29, 4:17 am, k3xji wrote: > On 29 Aralýk, 11:52, "Gabriel Genellina" > wrote: > > > En Mon, 29 Dec 2008 05:56:10 -0200, k3xji escribió: > snip > > > class wthread(threading.Thread): > > >     def run(self): > > >             try: > > >                 #GLOBAL_LOCK.acquireWrite() > > >    

Re: Read-Write Lock vs primitive Lock()

2008-12-29 Thread k3xji
On 29 Aralık, 11:52, "Gabriel Genellina" wrote: > En Mon, 29 Dec 2008 05:56:10 -0200, k3xji escribió: > > > I  am trying to see on which situations does the Read-Write Lock > > performs better on primitive Lock() itself. Below is the code I am > > using to test the performance: > > import threadi

Re: Read-Write Lock vs primitive Lock()

2008-12-29 Thread Gabriel Genellina
En Mon, 29 Dec 2008 05:56:10 -0200, k3xji escribió: I am trying to see on which situations does the Read-Write Lock performs better on primitive Lock() itself. Below is the code I am using to test the performance: import threading import locks import time class mylock(object): (I'm not conv

Read-Write Lock vs primitive Lock()

2008-12-29 Thread k3xji
Hi, I am trying to see on which situations does the Read-Write Lock performs better on primitive Lock() itself. Below is the code I am using to test the performance: import threading import locks import time class mylock(object): def __init__(self): self.__notreading = threading.Even