Message7558
The deque docs say that "Deques support thread-safe, memory efficient appends and pops from either side of the deque", but deque.popleft() isn't thread-safe. Under some circumstances the attached script throws a NullPointerException:
Exception in thread Thread:Traceback (most recent call last):
File "/Users/emptysquare/jython2.5.2/Lib/threading.py", line 179, in _Thread__bootstrap
self.run()
File "/Users/emptysquare/jython2.5.2/Lib/threading.py", line 170, in run
self._target(*self._args, **self._kwargs)
File "deque_play.py", line 9, in f
q.popleft()
NullPointerException: java.lang.NullPointerException
... under others it simply throws "IndexError: pop from an empty deque". Either error is wrong and inconsistent with the docs and with CPython's behavior. |
|
Date |
User |
Action |
Args |
2012-12-29 18:36:12 | ajdavis | set | recipients:
+ ajdavis |
2012-12-29 18:36:12 | ajdavis | set | messageid: <1356806172.77.0.608024060056.issue2001@psf.upfronthosting.co.za> |
2012-12-29 18:36:12 | ajdavis | link | issue2001 messages |
2012-12-29 18:36:12 | ajdavis | create | |
|