And to stave off some questions: I wasn’t paying attention to it because the documentation states that if “maxsize is less than or equal to zero, the queue size is infinite”. I did not in fact assume “infinite”. But did assume > 32,768. Which turned out to be naïve.
-
-
Show this thread
-
Debugging it was a fun story, too. At first I thought it was something else stalling out (since all the failures happened at suspicious powers of 2). Eventually isolated just the queue setup and saw it start to block put() at 32,768 items.
Show this thread -
So then I tried creating a queue with a higher maxsize, and got an immediate exception saying that’s not allowed. Turns out to be a hard-coded limit. Perhaps this should be documented better.
Show this thread -
(it’s not entirely Python’s fault, since this is actually handed off to system-specific non-Python semaphore implementations, and that’s where the hard-coded limit actually lives, but still, could be documented better)
Show this thread
End of conversation
New conversation -
-
-
And to clarify a bit: it’s 32,768 on my system. May be different on yours. The actual limit is your system’s SEM_VALUE_MAX.
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
So THAT’S why my first programming teacher made me learn the first 16 powers of two by heart.
-
When I was in High school (which was a looooong time ago), one of our teachers had us chanting "two to the tenth is ten twenty four" and insisted we would need to know that. He was right!
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.