We have a nice little fibonacci sequence being calculated at the moment.
Feels very dirty though. We also have multiple parallel threads where one
might be backlogged and the other is idle. This means we slow down the
backlogged thread.

We are looking at changing the way we do some of this, but at the moment,
our system actually performs better with more load.

I was thinking about making a call to a non-responsive web server (setup
one with a sleep) and use URL timeouts.

Thanks,
Jacob


On Wed, Sep 11, 2013 at 11:28 AM, Vinny P <[email protected]> wrote:

> On Tue, Sep 10, 2013 at 9:57 PM, Jacob Taylor <[email protected]>
>  wrote:
>
> Is there a safe way to sleep when using a multi-threaded python
>> application? We were seeing huge issues when we had a few regular small
>> sleep statements. i.e. common use cases that were sleeping for 1/4 second.
>>
>>
>
> Well, that's implementation dependent. Instead of doing sleep, you could
> move time-consuming application logic to where you need a delay. For
> instance, suppose you needed to do a urlfetch later on in your code. Why
> not do a synchronous urlfetch in place of the delay?
>
> Or you could use a push task, set it to countdown a short time before
> executing (
> https://developers.google.com/appengine/docs/python/taskqueue/tasks#Task see
> the countdown option). The push task then notifies whatever service to
> start leasing tasks from the pull queue.
>
> You could also fake it - for example, do a while loop that counts up to an
> outrageously high number. It's a bit of a waste of instance time, but
> whatever works!
>
>
>
> -----------------
> -Vinny P
> Technology & Media Advisor
> Chicago, IL
>
> App Engine Code Samples: http://www.learntogoogleit.com
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/google-appengine.
> For more options, visit https://groups.google.com/groups/opt_out.
>



-- 
Jacob Taylor
CTO, Kahuna
(650) 302-1864
www.useKahuna.com <http://www.usekahuna.com/>
http://www.linkedin.com/in/thejacobtaylor<http://www.linkedin.com/in/adammarchick>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-appengine.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to