Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Cancel threads after timeout

Reply
Thread Tools

Re: Cancel threads after timeout

 
 
Cameron Simpson
Guest
Posts: n/a
 
      01-28-2013
On 27Jan2013 21:57, Jason Friedman <> wrote:
| > 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.

I was thinking that if he does something equivalent to:

while :; do run-sql-query1-with-snapshot-of-result; sleep 900; done &
while :; do run-sql-query2-with-snapshot-of-result; sleep 900; done &
while :
do
report on latest pair of snapshots
sleep 7200
done

Then he doesn't need any timeouts.

Cheers,
--
Cameron Simpson <>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Cancel threads after timeout Cameron Simpson Python 0 01-27-2013 12:34 AM
Re: Cancel threads after timeout Matt Jones Python 0 01-26-2013 03:48 PM
Re: Cancel threads after timeout Jason Friedman Python 0 01-26-2013 03:43 PM
Cancel threads after timeout hyperboreean Python 0 01-26-2013 01:14 PM
HELP CANCEL CANCEL CANCEL Carmen Rosario Computer Support 7 04-06-2005 11:04 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57