Re: Cancel threads after timeout

Discussion in 'Python' started by Jason Friedman, Jan 28, 2013.

  1. > On 26Jan2013 09:48, Matt Jones <> wrote:
    > | It sounds like your real problem is with your SQL query... Is that part of
    > | this problem under your control? Can you break the query into smaller,
    > | quicker, pieces that you can run in a reasonable amount of time?
    >
    > Another option to investigate is whether you can ask the database itself
    > to limit the run time of a query. Of course, that will abort the query
    > but so does your proposed solution.
    >
    > Another approach might be to simply run each query regularly (with a
    > pause between so the database is not spending its whole life running
    > your query). Snapshot each latest result. Compute your report from the
    > latest pair of snapshots at any given time on an independent schedule.
    > It may not be valid for what you need, but if it is then this decouples
    > you from the query time completely.


    Along these lines, if you are running on Linux then the bash shell
    comes with a "timeout" command, which you can prepend to snapshot
    requests.
    Jason Friedman, Jan 28, 2013
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hyperboreean

    Cancel threads after timeout

    hyperboreean, Jan 26, 2013, in forum: Python
    Replies:
    0
    Views:
    127
    hyperboreean
    Jan 26, 2013
  2. Jason Friedman

    Re: Cancel threads after timeout

    Jason Friedman, Jan 26, 2013, in forum: Python
    Replies:
    0
    Views:
    117
    Jason Friedman
    Jan 26, 2013
  3. Matt Jones

    Re: Cancel threads after timeout

    Matt Jones, Jan 26, 2013, in forum: Python
    Replies:
    0
    Views:
    122
    Matt Jones
    Jan 26, 2013
  4. Cameron Simpson

    Re: Cancel threads after timeout

    Cameron Simpson, Jan 27, 2013, in forum: Python
    Replies:
    0
    Views:
    129
    Cameron Simpson
    Jan 27, 2013
  5. dieter
    Replies:
    0
    Views:
    142
    dieter
    Jan 27, 2013
Loading...

Share This Page