On Mon, Aug 06, 2018 at 09:27:18AM +0200, Stephan Gatzka wrote:
> Hi!
>
> > I came up with the following solutions to this problem:
> > (1) Poll the state using the unix domain socket and PTP messages
> > (2) Extend the event system of linuxptp (SUBSCRIBE_EVENTS_NP)
> > (3) Provide hooks at some places inside linuxptp
> >
>
> (1) is not desirable because of polling. I would opt for (2). The main
> reason is that we can reuse the existing event mechanism.
Yes, that is whole idea of having a push mechanism. So far, there
hasn't been any specific need to extend it.
And despite what programmers are taught to believe, polling really
isn't always evil. You could make a perfectly adequate network
monitoring tool with this pattern:
while [ 1 ]; do
pmc -4 -b 2 -i eth0 "get foo" "get bar" | pretty_display
sleep 2
done
After all, any time critical actions are taken by ptp4l directly.
Thanks,
Richard
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Linuxptp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxptp-devel