I am currently working with a raspberry pi.
I have written a simple library to control a 7 segment display and it works fine. I also made several programs that use the library.
I need to make sure that at any time only one program is trying to control the gpio's. My first idea was to create a lock on a specific file.
How good practice is this and what's the best way to completely realize that?
(To clear this up: I do not neccesarrily want to block all programms from using the gpio's. It would be enough if only one program using my library could acces the gpio's)