J
Jeff Epler
I still have a question. Is the GIL necessary even if there is
no sharing of data between threads?
Data is always shared between threads. One object you're almost certainly
sharing between threads is "None". In the CPython implementation, None
has a refcount just like any other object, and that refcount is modified
in any statement involving None, and by the implicit "return None" at
the end of a function.
The GIL has the effect (among other things) of ensuring that changes to
refcounts are serialized among threads.
Jeff
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)
iD8DBQFA++/8Jd01MZaTXX0RAvsrAJ9p8hv73VuAx70cXIbVwTkChSixQwCfaK3f
3TqSTTebPaORxxntjV46g18=
=fmrN
-----END PGP SIGNATURE-----