Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #74656 > unrolled thread

Re: Blocked thread

Started byChris Angelico <rosuav@gmail.com>
First post2014-07-18 04:01 +1000
Last post2014-07-18 04:01 +1000
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Blocked thread Chris Angelico <rosuav@gmail.com> - 2014-07-18 04:01 +1000

#74656 — Re: Blocked thread

FromChris Angelico <rosuav@gmail.com>
Date2014-07-18 04:01 +1000
SubjectRe: Blocked thread
Message-ID<mailman.11939.1405620077.18130.python-list@python.org>
On Fri, Jul 18, 2014 at 3:55 AM, Larry Martell <larry.martell@gmail.com> wrote:
> I can have as many connections to the db server as I want, that's not
> the issue. The issue is that my main thread seems to be blocked in the
> join(), so I guess I'm going to need a separate script. I was trying
> to avoid that.

Right, but what you're trying to do is monitor the local thread, by
spinning off a thread to do the deletion and then keeping an eye on it
by attempting a timed join. I'm saying it'd probably be easier to do
the monitoring on the server end, via a second connection. (It most
likely doesn't need special database privileges, even; at least in
PostgreSQL, any user can see pg_stat_activity entries for the same
user.) That's usually going to be more reliable, plus the server can
tell you whether the deletion is blocked waiting for a lock or busy
writing to the disk or something else.

ChrisA

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web