A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-August/016804.html below:

[Python-Dev] Free threading

[Python-Dev] Free threading [Python-Dev] Free threadingGuido van Rossum guido@python.org
Wed, 08 Aug 2001 18:30:54 -0400
> We need thread-local storage, anyway.  When I'm a little farther into my
> work on Decimal, I'm going to take a hard look at this because context
> needs to be global on a per-thread basis...

(Thick French accent:) "We already got one!"

In the C API, use PyThreadState_GetDict(): it returns a per-thread
dictionary.  The convention is that you pick a key unique to your
extension module (e.g. your full extension module name) and then store
your per-thread data under this key.

In Python, you can store instance variables on the current thread
object -- use threading.currentThread() to access it.

--Guido van Rossum (home page: http://www.python.org/~guido/)



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4