qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Stitcher <astitc...@redhat.com>
Subject Re: API question
Date Mon, 05 Nov 2007 17:17:17 GMT
On Mon, 2007-11-05 at 11:40 -0500, Alan Conway wrote:
> ...
> Agreed - but why would we impose that on the user? What additional
> flexibility would they gain?

I guess what I'm really saying is that internally you have to do it with
an absolute time, so you might as well expose that to the user as well
in case that's how they want to cast their code, so as per my second
message we should supply *both* options.

For example if you want to use these timeouts to keep strict
time/frequency constraints (and our users might as far as we know) it's
much easier to do it with an absolute time API than a relative one.

All you do is keep adding a fixed offset to the previous time to
approximate closely to a fixed frequency. Whereas if you use a relative
and use the same duration each time then your frequency will drift as
you wake up later and later than the desired time.

Does this make sense to you?

BTW I'm not suggesting that you return externally for any other reason
than got message or timeout.

BTW2 this is a major flaw in the epoll() interface compared to the
select() one in that if you get booted out due to an interrupt you have
no way of knowing how much longer you need to wait for, unless you kept
track of the expected absolute timeout time yourself.

Andrew

> 
> Cheers,
> Alan.
> 


Mime
View raw message