gpsd-dev
[Top][All Lists]
Advanced

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

Re: [gpsd-dev] shm, volatile, etc.


From: Harlan Stenn
Subject: Re: [gpsd-dev] shm, volatile, etc.
Date: Tue, 05 Nov 2013 19:57:06 +0000

In this case all we're trying to do is to tell the compiler to check the
value because it may have changed due to unknown/outside events.
Reordering is not a problem.

And there is something to be said for looking at message queues or a
socket instead, but those have other/different problems.

If we remove 'volatile' in this case a "smart" compiler can look at the
code and decide to never re-read these variables, as nothing in the code
path would show that they could ever be changed.

Which of the various approaches produces the best results in the widest
number of circumstances?  The good news is that we *can* tailor this on
a per-architecture basis, as the data is only updated on the "current"
machine.

H



reply via email to

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