Thread starts, but control never moves past start() call.

Greetings all,
   I am working on a simple google AppEngine app that uses python threads. The POST method for MainHandler is where the problem is. The Post method here is supposed to start a thread (which does background downloading) as the last thing before it returns (sending the HTML response). The problem is that although the threads starts just fine, program control doesn't move beyond the start() statement - and so doesn't leave the POST method until the thread is actually finished. It is as though the join() method was called on this thread. I have also tried using a Timer in case the thread was simply hogging cpu time so that control couldn't get to the 'return' fast enough. But that wasn't it either.
     The threading code was working fine before I converted it to a Google App. Threads would start and control would move on to the next commands every time. Is there something specific about server-side google apps, or is there some workaround with more advanced threading?...

# from class MainHandler(webapp.RequestHandler):

def post(self):
	logging.info( "ENTERED 'POST' METHOD" )

	self.response.headers['Content-Type'] = 'text/html'
	self.response.out.write(HTMLHeader()) 		
	self.response.out.write( "<p>-- PROCESSING --</p>" )
	self.response.out.write(HTMLFooter())
	logging.info( "LEAVING 'POST' METHOD" )
		
	myPersonDownloader.start()
	#Timer(3.0, myPersonDownloader.start ).start()
		
	return  # Doesn't get here until thread is finished.
----------
...
----------
def main():
	application = webapp.WSGIApplication(
		[('/.*', MainHandler)], debug=True)
	wsgiref.handlers.CGIHandler().run(application)


if __name__ == '__main__':
  main()

Open in new window

tau161Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

tau161Author Commented:
I found the unfortunate answer that I was looking for here.  Google App Engine does not support threading.  I wrote a fully working set of threaded base code which is now useless.  I have rewritten it from the ground up using Tasks, TaskQueues, and the Datastore, but it's just not the same. It feels like a hack job.  

Cheers
0
EE_AutoDeleterCommented:
tau161,
Because you have presented a solution to your own problem which may be helpful to future searches, this question is now PAQed and your points have been refunded.

EE_AutoDeleter
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Python

From novice to tech pro — start learning today.