Relatively new to RPi coding and gpiozero in particular. Pardon ignorance, please. The pin factory stuff is good for 'reserving' pins within a specific process, but is there a builtin mechanism, or supported workaround, for reserving them Pi-wide? I expected that starting up another process that tried to use the same pins as an existing process would be blocked, but the result was.. not that.

Is there a preferred/supported mechanism for using IPC locks or mutices/semaphores to truly reserve GPIO pins Pi-wide?

1 Answer 1


There is no way of reserving GPIO Pi wide.

A lot of the existing Pi GPIO libraries talk directly to the hardware and the last library to configure a GPIO wins.

The kernel supports claiming GPIO but this only works if other software use the same interface (and unfortunately the claim only lasts for the duration of the software process).

  • Thanks. So if I'm the only user of the Pi (i.e., all of the software is under my control), I'd have to write my own wrappers for this? (Apologies for terminological confusion; I'm used to thinking of 'GPIO' as meaning the entire J8 header, not just single pins.)
    – RoUS
    Jul 25, 2023 at 19:27
  • Yes, you would have to mediate use of the GPIO.
    – joan
    Jul 25, 2023 at 19:38
  • Thank you! for the explanation and confirmation.
    – RoUS
    Jul 25, 2023 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.