pcp
[Top] [All Lists]

Re: pmServiceDiscoveryInterrupt() commit a8b87e2 et al.

To: Dave Brolley <brolley@xxxxxxxxxx>, "Frank Ch. Eigler" <fche@xxxxxxxxxx>
Subject: Re: pmServiceDiscoveryInterrupt() commit a8b87e2 et al.
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Tue, 1 Jul 2014 03:54:21 -0400 (EDT)
Cc: pcp@xxxxxxxxxxx
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <y0m7g3yd6xy.fsf@xxxxxxxx>
References: <20140619194444.3B03D58015@xxxxxxxx> <53AB0F27.602@xxxxxxxxxx> <1063089485.33910956.1403758262805.JavaMail.zimbra@xxxxxxxxxx> <53AC35B8.3000802@xxxxxxxxxx> <1193390011.34470957.1403829231937.JavaMail.zimbra@xxxxxxxxxx> <1374649635.181830.1404090114319.JavaMail.zimbra@xxxxxxxxxx> <y0m7g3yd6xy.fsf@xxxxxxxx>
Reply-to: Nathan Scott <nathans@xxxxxxxxxx>
Thread-index: y1O2H0KkGwyCJndYbQsz+ah5eP8Vow==
Thread-topic: pmServiceDiscoveryInterrupt() commit a8b87e2 et al.

----- Original Message -----
> [...]
> FWIW, since the abi comes to include the version# in the field, it is
> IMHO a little worse than just putting the version number right into
> the function name.  At least with that approach, we would have proper
> type checking by the compiler for each version.  That's something lacking
> in version-tagged structs -- and a hassle with e.g. the pmda structure.
> 

Yep, that is an advantage.  The disadvantages though are that over time,
the API becomes a real (repetitive) mess, once many extensions exist.  If
done right (so not like pmda dispatch - but that is a much more complex
example, with multiple indirect structures), can give much cleaner code
from the callers POV for client tools supporting multiple libpcp variants.

The API and header file end up with N x data structures and N x APIs (as
does libpcp.so ABI of course) for each new addition.  So as N increases,
its an increasingly poor choice - the pmapi.h header becomes a twisty
maze of very-similar-structs.

Plus, there's good precedence with existing APIs ... so lets stick with
the current model (that one advantage isn't sufficiently compelling to
change things up, IMO).

cheers.

--
Nathan

<Prev in Thread] Current Thread [Next in Thread>
  • Re: pmServiceDiscoveryInterrupt() commit a8b87e2 et al., Nathan Scott <=