Message116673
One more thing:
in the sample code, the thread initializes no PyThreadState. So the ctypes callback creates a temporary PyThreadState just for the duration of the call.
This explains the difference between threading.local and _threading_local:
- threading.local() uses the PyThreadState to store its data: You get a new value on each call.
- _threading_local.local() uses a global dictionary indexed by the thread id: the same value is retained across call. |
|
Date |
User |
Action |
Args |
2010-09-17 15:28:48 | amaury.forgeotdarc | set | recipients:
+ amaury.forgeotdarc, ncoghlan, nikratio, verigak, swapnil, anacrolix |
2010-09-17 15:28:48 | amaury.forgeotdarc | set | messageid: <1284737328.05.0.64793036339.issue6627@psf.upfronthosting.co.za> |
2010-09-17 15:28:45 | amaury.forgeotdarc | link | issue6627 messages |
2010-09-17 15:28:45 | amaury.forgeotdarc | create | |
|