From: Pierre-Alexandre V. <ont...@gm...> - 2013-01-10 12:20:17
|
Hello, I'm facing more and more a problem with my application which is based on NetHTTPd/NetCGI. My software is based on CGI entry point (url and arguments values). Each CGI opens a memcache + postgreSQL connexion, makes his task, closes memcache + postgreSQL connexion and return the result (a string of course, most of the time JSON data). I use Memcache for several reasons, partly because of my inability to understand how to use shared memory despite the tutorial. Some CGI are becoming to long to execute (more than 30s). Usually, the result I need to return is calculated quickly (less than 15s), but I need to make lot of treatments before returning it. Thus, I'm looking for a way to return the result my client need, and continuing all tasks I need. So, I need to launch an asynchronous task. The ugly way I only see is to make my app calling itself by Http, give to the CGI, all the information it need to continue the task. But it is so ugly, I can't make it this way. Is there a way to lauch a task asynchronously ? Can I use a thread without risk ? Regards, P-A -- --------------------- https://twitter.com/#!/ontologiae/ http://linuxfr.org/users/montaigne |