The Changing "Guarantees" Given by Python's Global Interpreter Lock
1–10 of 142 posts
Re: The Changing "Guarantees" Given by Python's Global Interpreter Lock
#2Re: The Changing "Guarantees" Given by Python's Global Interpreter Lock
#3Code that assumes that something is going to be atomic because of the GIL (or any other implementation detail) is simply broken. If you need something to be atomic you should be explicit about that and use mutex or something.
Re: The Changing "Guarantees" Given by Python's Global Interpreter Lock
#4Re: The Changing "Guarantees" Given by Python's Global Interpreter Lock
#5Why does Python use an un-comparable version number scheme? Not being a Python programmer, comparing version 3.9 to 3.13 seemed bizarre until I caught on.
Re: The Changing "Guarantees" Given by Python's Global Interpreter Lock
#6Code that assumes that something is going to be atomic because of the GIL (or any other implementation detail) is simply broken. If you need something to be atomic you should be explicit about that and use mutex or something.
Re: The Changing "Guarantees" Given by Python's Global Interpreter Lock
#7Why does Python use an un-comparable version number scheme? Not being a Python programmer, comparing version 3.9 to 3.13 seemed bizarre until I caught on.
Re: The Changing "Guarantees" Given by Python's Global Interpreter Lock
#8Why does Python use an un-comparable version number scheme? Not being a Python programmer, comparing version 3.9 to 3.13 seemed bizarre until I caught on.
Re: The Changing "Guarantees" Given by Python's Global Interpreter Lock
#9a more interesting example is something like this:
# setup
l = []
# thread A
l.extend([1, 2, 3])
# thread B
l.extend([4, 5, 6])
is the resulting list always within the set of [1,2,3,4,5,6] or [4,5,6,1,2,3] ? or are the two sets of numbers randomly interleaved in the list? or if the GIL is removed does the interpreter segfault (I'm pretty sure this latter will not be the case for GIL removal but I don't understand the gil remove plan very much yet).Edit: before people jump in and correct how the above is a bad idea anyway, it's not like I'd ever do the above and expect anything but disaster. This is more of a thought experiment to understand what GIL removal is going to do.
Re: The Changing "Guarantees" Given by Python's Global Interpreter Lock
#10these examples of "what one would assume to be atomic" did not seem useful to me, they looked like things that are obviously not threadsafe. a more interesting example is something like this: # setup l = [] # thread A l.extend([1, 2, 3]) # thread B l.extend([4, 5, 6]) is the resulting list always within the set of [1,2,3,4,5,6] or [4,5,6,1,2,3] ? or are the two sets of numbers randomly interleaved in the list? or if…