[LinuxPPS] multiple access to /dev/ppsN entries

Ben Gardiner bengardiner at nanometrics.ca
Fri Mar 19 14:38:47 CET 2010


On Fri, Mar 19, 2010 at 7:03 AM, Bernhard Schiffner
<bernhard at schiffner-limbach.de> wrote:
>
> On Friday, 19. March 2010 11:20:14 George Spelvin wrote:
> > > George's patch makes a read() possible every time.
> > > So  a  select(...) on  *readfds makes  no sense. The only way is to
> > > "fill" *exceptfds by the driver when receiving a new timestamp.
> >
> > No, it doesn't.  Read blocks until there's a new timestamp; the simplest
> > way to view it is "cat /dev/ppsX".
>
> Good news!
> Correct me please if I'am wrong: This blocking will be left when a new result
> is there _and_ the using application is schedulded the next time (means
> usually something below a millisecond later).
>
> @Ben: Is this good enough for your purposes?


> On Friday, 19. March 2010 11:20:14 George Spelvin wrote:
> > The onle big *mistake* in my patch set was that I made *all* the
> > parameters per-fd, but while nothing in the PPSAPI spec requires all
> > users to have the same event set (and letting different readers use
> > different ines is quite useful), a careful reading shows that it expects
> > the offset values to be global.

Hi George, thanks for elaborating on the details of the behaviour of
reads to /dev/ppsX.

I don't understand what 'offset' means in this context. Is it a time
offset or a position offset into a bytestream provided by /dev/ppsX?

I would like to have two separate processes use the same /dev/ppsX
entry to react to the same PPS 'events' and I am imagining doing so by
blocking reads in each application. It seems that if this offset is a
bytestream position then my two processes will race to get the event
information and inconsistent behaviour will result.

Am I wrong about this behaviour?

Is there a better approach I can take with callback functions?

Best Regards,

Ben Gardiner



More information about the LinuxPPS mailing list