Example:
image = Image.open('foo.png')
# releases the GIL?
resized = image.resize((800, 600), Image.ANTIALIAS)
# reacquires the GIL?
Obviously the variable assignment needs to hold the GIL, but it’s difficult to break that up into two lines. 🙂
If there are two threads doing image resizes, can those resizes run on two different cores?
Looking at the source of 1.1.7, it doesn’t appear to release the GIL for
_resize.The functions that release the GIL seem to be: