POV-Ray : Newsgroups : povray.off-topic : Linux: best way to communicate between processes? : Re: Linux: best way to communicate between processes? Server Time
3 Jul 2024 02:39:55 EDT (-0400)
  Re: Linux: best way to communicate between processes?  
From: Aydan
Date: 17 May 2016 10:40:01
Message: <web.573b2c1f2b37d2ddd0f66c6d0@news.povray.org>
scott <sco### [at] scottcom> wrote:
> 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?

PIGPIO and GPIOZERO don't need root anymore, the user just needs to be in the
gpio group

Regards
Aydan


Post a reply to this message

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