POV-Ray : Newsgroups : povray.off-topic : Linux: best way to communicate between processes? : Linux: best way to communicate between processes? Server Time
1 Jul 2024 03:31:14 EDT (-0400)
  Linux: best way to communicate between processes?  
From: scott
Date: 16 May 2016 08:47:30
Message: <5739c162@news.povray.org>
On my pi I'm running raspbian, and have a process running as root to 
read a pin on the GPIO (connected to a PIR). Only root can read the GPIO 
pins, but obviously I don't want large, complex programs running as root 
just because they need to read a pin on the GPIO.

What's the best way for this root process to "broadcast" to other 
(non-root) processes when that pin goes high? It will only happen at 
maximum frequency of about every 2 seconds, but any delay between the 
pin going high and the other processes seeing it should be minimal.

I did think about using a file, that was write permission only for root, 
but readable by everyone, that seems like a lot of overhead though (and 
what if root tries to write to it as someone else is reading it?). In 
Windows I might consider using a broadcast message with the PostMessage 
API function, is there something similar for Linux?


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.