Alessandro GARDICH <[EMAIL PROTECTED]> writes:

> the program is quite simple, a loop do UPDATE on a random entry on a
> table. Server is without autocommit. 
> 
> with setittimer and SIGALRM i do an explicit COMMIT every 10 seconds,
> update loop have a random delay from 0 to 500 msec using usleep().

I don't know the full answer to your question, but I don't think it's safe to
call libpq functions from signals handlers. It's not really safe to do much of
anything in signal handlers in fact. Even functions like printf() and malloc()
aren't technically safe to call from signal handlers.

What you should probably do is set a flag that you check upon completion of
the usleep() or after every update, and handle the commit there.

-- 
greg


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to [EMAIL PROTECTED] so that your
      message can get through to the mailing list cleanly

Reply via email to