[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gpsd-dev] Updated docs on NTP segment management

From: Hal Murray
Subject: Re: [gpsd-dev] Updated docs on NTP segment management
Date: Wed, 25 Feb 2015 23:24:07 -0800

address@hidden said:
> Well, the thing that had been byting me is the lack of a way to mark an
> NTPSHM as 'in-use'.  If I am not really careful I get gpsd and ptp4l both
> trying to step on shmid NTP0. 

That sounds like a vote for the client side to run in read-only mode.

> The root:rooot/600 and root:root/666 perms thing also recently bit me. We
> gotta do ntpd:ntpd/660 or gpsd:ntpd:660. 

If the client side is read only, the permissions can be gpsd:gpsd:644.

> Another possibility, still noodling on it, would be to put a real POSIX
> semaphore inside the SHM, so the slaves do not need to keep polling, plus
> that give you a memory barrier for free. 

The basic structure of ntpd is single threaded.  The inner dispatcher does a 
select, so file descriptors get good response.  Can I do a select on a 
semaphore?  Is there a way to turn a semaphore or queue into something select 
can use?

The other problem with semaphores is how to initialize them.  Remember that 
either ntpd or gpsd can start first and crash or restart at any time.  There 
may be a solution to that tangle, but I haven't seen one and this topic has 
been kicking around for a while.

These are my opinions.  I hate spam.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]