New issue 2513: nogil-unsafe-2 has gil ?
https://bitbucket.org/pypy/pypy/issues/2513/nogil-unsafe-2-has-gil

Altan Özlü:

Hi! i want to work around gil-less pypy and i did compile nogil-unsafe-2 branch 

```
#!python

import threading,time

def x():
    b=0
    for a in range(20000000):b+=a*a
class myThread (threading.Thread):
    def __init__(self):
        threading.Thread.__init__(self)
    def run(self):
        x()
t=time.time()
trs=[]
for c in range(4):
    m=myThread()
    m.start()
    trs.append(m)
for tr in trs:tr.join()
print "4 thread",time.time()-t
t=time.time()
for c in range(4):
    x()
print "1 thread", time.time()-t
```

* 4 thread 1.40300607681
* 1 thread 1.34966206551

why it doesn't work ?


_______________________________________________
pypy-issue mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-issue

Reply via email to