On 30/11/2019 21:11, druck wrote:
> On 30/11/2019 19:34, The Natural Philosopher wrote:
>> On 30/11/2019 16:38, druck wrote:
>>> For example, to get a running average of the CPU temperature over a
>>> period of 15 minutes, I wrote a python program which runs as a daemon
>>> at start up, reading the CPU temperature every second calculating the
>>> running average, min and max values. The values are read by running
>>> another instance of the program which communicates with the daemon
>>> instance via a named pipe.
>>>
>>
>> I actually did something simuilar to get data from a sound deamon back
>> to a contrilling web browser, but I didn't use a pipe. I created a
>> ramdiosk of a few K and mounted that and wrote a file in it. Daemon
>> writes: browser reads.
>>
>> Very simple.
>>
>> Cant ever fill up. It just gets overwritten by 'current state' every
>> so often...
>
> The only problem being if someone tries reading while it being
> re-written.
I dont think that can happen.
Disk writes are atomic operations as are disk reads below the sector level.
Did you use advisory locking, or a write and replace strategy?
>
> ---druck
>
--
There is something fascinating about science. One gets such wholesale
returns of conjecture out of such a trifling investment of fact.
Mark Twain
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|