Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: select/poll bug?

On Sun, 3 Aug 2008 13:18:14 -0400
"Greg A. Woods; Planix, Inc." <> wrote:

> On 3-Aug-08, at 2:45 AM, Roy Marples wrote:
> > On Sat, 2008-08-02 at 22:07 -0400, Greg A. Woods; Planix, Inc.
> > wrote:
> >> I'm not sure why you want to set a timer for the whole lease.
> >>
> >> Why not set a regular timer and decrement the remaining lease TTL
> >> on that interval?
> >>
> >> The extra CPU cycles through such a loop, even counting all the  
> >> kernel
> >> time for the system call transitions, is inevitably negligible over
> >> such periods as DAYS.
> >
> > For the duration of the lease we need to monitor a signal pipe and
> > the fd for link carrier messages. As select,poll and friends have
> > timeouts it makes sense to use them instead of calls like setitimer.
> You still haven't said why you need a timer that can handle in one  
> setting the span of the entire maximum possible lease time.  Why not  
> set a regular interval timeout and decrement the elapsed time from
> the lease TTL every time the timeout happens until finally there's no
> time remaining on the lease, perhaps adjusting the interval of the
> timeout as the lease nears its expiry time.
Agreed.  (If memory serves, I've had problems with leases on laptops
because the timer didn't run while it was suspended.)

                --Steve Bellovin,

Home | Main Index | Thread Index | Old Index