durusmail: quixote-users: Fwd: [Quixote-users] Long running task.
Long running task.
2005-01-22
Re: Long running task.
2005-01-24
2005-01-24
Fwd: [Quixote-users] Long running task.
2005-01-26
Re: Fwd: [Quixote-users] Long running task.
2005-01-26
2005-01-27
2005-01-27
2005-01-27
Fwd: [Quixote-users] Long running task.
Darryl
2005-01-26
Arg. I just realized I replied only to Etienne.
Following is the email that intended to be delivered to this list.


---------- Forwarded message ----------

>
> Hi Darryl,
>
> As always, there are many ways to do this. They are not necessarily
> Quixote specific though. The first thing that comes to mind is to use
> threads. But be very careful with it, if you don't watch carefully
> that the stuff you do in the thread does not affect any other requests
> while it does it's thing, you will get concurrency issues that bite
> you later.
> Try and avoid threads.
>
>

The first thing I tried was starting a thread and throwing the
processing to it and then immediately after calling the thread
returning a result to the browser (so the thread can work in the
background). Apparently I'm not doing that correctly because it starts
the thread fine but waits for the thread to finish before returning
the result to the browser.

Right now I'm considering having it dump a task into a database and
having a seperate application polling the database for new rows and
then processing. What I was trying to avoid was managing two seperate
processes.

The threading that I tried was based on the longrunning task example
on the wiki:
http://www.quixote.ca/qx/LongRunningProcesses
Should that not work for SGCI ?

-darryl


--
http://randomthoughts.vandorp.ca

reply