You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by Jan Algermissen <ja...@nordsc.com> on 2011/11/10 13:50:06 UTC

Pausing a long running 'computation'

Hi,

suppose I have a potentially long running computation[1] in a plugin. It will be short most of the time but might be longer.

What I am looking for is a way to ensure that the computation does not block the main request handling thread.

Can you point me to the documentation page where I can read how this is done best or what approaches there are?

Based on my vague understanding, I think I could a) start a new thread or b) suspend the computation and hand control back to the main loop.

a) Seems inappropriate for my case because it will usually be short

Regarding b) I have no idea how to do that with TS. Is that described anywhere?

Jan

[1] Think: evaluating an expression



Re: Pausing a long running 'computation'

Posted by Leif Hedstrom <zw...@apache.org>.
On 11/10/11 5:50 AM, Jan Algermissen wrote:
> Hi,
>
> suppose I have a potentially long running computation[1] in a plugin. It will be short most of the time but might be longer.
>
> What I am looking for is a way to ensure that the computation does not block the main request handling thread.
>
> Can you point me to the documentation page where I can read how this is done best or what approaches there are?
Basically, you want to reschedule yourself, and (typically) make sure you 
don't re-enable the HttpSM, or it will proceed with the state machine.

-- leif