[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: (a.josey 12144) Re: (c.harding 29009) Re: c-api-03 minor nits



Personally, I'd like to drop kick 'struct timeval' completely.

The API spec has timelimit (protocol) and timeout (API) intertwined
deeply.  They are two very different beasts and should be separated.
It makes little sense to me why someone would want a server to
search for N seconds but only wait N seconds for the response.
I would think applications would want to wait M seconds beyond
the server timelimit they specified.

(You could argue that I should use async calls to implement
this behavior.  I would argue back, why have sync calls then?)

As far as timeout goes, most of the _s routines don't have
standard mechanism for specifying a timeout.  It's likely
that some API implementors will come up with a client
side control to allow specification of a timeout on all
blocking operations.  In fact, using a control for the
API timeout is nice as it allows each implementor choose
which system specific timeout specification is most
appropriate.  On some systems, maybe it's a time_t,
others a timespec, others a time string.

But, I'm afraid, it's too late for this particular rant...

Kurt

At 03:01 PM 6/10/99 +0100, Chris Harding wrote:
>Hi -
>
>At 18:34 09/06/99 -0400, Mark Smith wrote:
>>"Kurt D. Zeilenga" wrote:
>
>>> ...
>>> 6) struct timeval
>>> 
>>> Not all systems timeval fields are of type 'long'.
>>> Implementations must be allowed to declare struct
>>> timeval as it is found in primary header files of
>>> the current C translator.
>>
>>I didn't realize that was the case.  Is timeval defined in a POSIX spec.
>>(it must be)?  It would be nice to have a reference.
>>
>struct timeval is defined in the Single UNIX Specification (Open Group
>Publication, see
>http://www.opengroup.org/onlinepubs/007908799/xsh/systime.h.html ) to be
>available when <sys/time.h> is included and to contain fields 
>
>   time_t       tv_sec        seconds
>   suseconds_t  tv_usec       microseconds
>
>I don't beleive that it is defined in ISO 9945 or IEEE 1003.1 (POSIX).
>Rather, POSIX defines struct timespec, to be available when <time.h> is
>included, and containing:
>
>   time_t       tv_sec        seconds
>   long         tv_nsec       nanoseconds
>
>The argument for the timespec as opposed to the timeval structure is that,
>these days, microseconds are a pretty coarse granularity for timers.
>
>You might consider changing the LDAP API to use timespecs rather than
>timevals.
>
>BTW, a very minor nit, in the definition of ldap_compare_ext (section 10.9,
>page 30), there should be a comma following "struct berval *bvalue".
>
>
>
>Regards,
>
>Chris
>+++++
>
>-------------------------------------------------------------------------
>           Chris Harding
>  T H E    Development Manager
> O P E N   Apex Plaza, Forbury Road, Reading RG1 1AX, UK
>G R O U P  Mailto:c.harding@opengroup.org   Ph: +44 118 950 8311 x2262
>           WWW: http://www.opengroup.org    Fx: +44 118 950 0110  
>
>OSF/1, Motif, UNIX and the "X" device are registered trademarks in
>the US and other countries, and IT DialTone and The Open Group are
>trademarks of The Open Group.
>-------------------------------------------------------------------------
>
>