in reply to DBI messes up sleep

Sleep is woken by signals. Perhaps some are being used by the database driver. Just keep going back to sleep until you want to wake up.

# Optional, but a good idea with short durations. use Time::HiRes qw( sleep time ); sub uninterrupted_sleep { my ($duration) = @_; die if !$duration; my $sleep_till = time() + $duration; while ($duration > 0) { sleep($duration); $duration = $sleep_till - time(); } }

Replies are listed 'Best First'.
Re^2: DBI messes up sleep
by perljunky (Sexton) on Sep 14, 2007 at 21:17 UTC
    When I put another sleep 30 at the end of the while loop the second sleep doesnt really sleep but then the first sleep kicks in and works as expected.
      That's consistent with what I said. That it only interrupts once is great! My solution will handle that nicely.

      Definitly sounds like a bug that should be reported to the DBI maintainers.


      ___________
      Eric Hodges

        That seems quite hasty.

        DBD driver, database library and system configurations aside, we haven't even definitively eliminated the usual suspect: the end-user. :) Can you reproduce perljunky's symptoms with the given code and an accessible Oracle data source? I cannot.

        -pilcrow