[Top][All Lists]

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

Re: ✘GPS 3.24 is released!

From: Hal Murray
Subject: Re: ✘GPS 3.24 is released!
Date: Sun, 08 May 2022 13:55:32 -0700

> Not priviledged, but syncrhouns only.  gpsd needs to be async once it is
> running.  Otherwise the buffers back up and game over.

Is the game really over?  Will the pseudo threads parsing the input streams 
recover from lost data?  If so, what is the value of the DNS lookup (or 
whatever) that doesn't happen often compared to the occasional trashing of the 
input stream?

> Of course if you want convert gpsd to multhreaded operation, then those
> problems go away. 

I've done it for ntpd -- not real threads, just another quirk for the current 
pseudo thread scheduler to handle.  It's not hard, at least if you are already 
familiar with threads.

The general idea is to set a flag, fork a real thread to do the DNS lookup, 
than continue after the answer is available.

The handshake code is a bit ugly/tricky since it is small pieces spread all 
over the place.

There are 2 areas to keep in mind.  The DNS thread can't call utility routines 
unless they are thread safe.  One obvious example is logging.

The other is that you can't have a lot of state on the stack when you want to 
do the DNS lookup.  The DNS lookup gets tangled up with the top-level pseudo 
thread scheduler.

These are my opinions.  I hate spam.

reply via email to

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