Multi-threading on Google app engine
Found the issue.  I was calling start_background_thread with argument set to function().  When I fixed it to calling it as function it worked as expected.
Does Google App engine support multithreading? I am seeing conflicting reports on the web.
Basically, I am working on a module that communicates with Apple Push Notification server (APNS).  It uses a worker thread that constantly looks for new messages that need to be pushed to client devices in a pull queue.
After it gets a message and sends it to APNS, I want it to start another thread that checks if APNS sends any error response in return.  Basically, look for incoming bytes on same socket (it can only be error response per APNS spec). If nothing comes in 60s since the last message send time in the main thread, the error response thread terminates.
While this "error response handler" thread is waiting for bytes from APNS (using a select on the socket), I want the main thread to continue looking at the pull queue and send any packets that come immediately.
I tried starting a background thread to do the function of the error response handler.  But this does not work as expected since the threads are executed serially.  I.e control returns to the main thread only after the error response thread has finished its 60s wait.  So, if there are messages that arrive during this time they sit in the queue.
I tried threadsafe: false in .yaml
My questions are:

Is there any way to have true multithreading in GAE.  I.e the main thread and the error response thread execute in parallel in the above example instead of forcing one to wait while other executes?
If no, is there any solution to the problem I am trying to solve?  I tried kick-starting a new instance to handle the error response (basically use a push queue), but I don't know how to pass the socket object the error response thread will have to listen to as a parameter to this push queue task (since dill is not supported to serialize socket objects)