Question
How do I get a thread under Python to return a value to the main thread?
Answer
TLS with Pthreads (Thread Specific Data) is similar to TlsAlloc & co. for Windows. pthread_key_create creates a key, with an optional destructor, that can later be associated with thread specific data via pthread_setspecific. The data can be retrieved using pthread_getspecific. If the thread specific value is not NULL, the destructor will be called when the thread exits. Additionally, key must be destroyed with pthread_key_delete.
— Source: Wikipedia (www.wikipedia.org)