Hello Bartosz, I am writing a libgpiod 2 C# binding/abstraction for the dotnet community that I want to use personally. My use case is to monitor edge events from a hardware PWM signal, to react by reading some other GPIOs in a relatively short amount of time. This is likely a very specific use case but my goal is to make the binding cover as much uses cases as possible. And before searching for an alternative (like writing a kernel driver or so) I wanted to make sure I am not doing things wrong. Regards Mathias Am Di., 12. Dez. 2023 um 12:12 Uhr schrieb Bartosz Golaszewski <brgl@xxxxxxxx>: > > On Tue, Dec 12, 2023 at 10:55 AM Mathias Dobler <mathias.dob@xxxxxxxxx> wrote: > > > > Hello, > > From reading other conversations I've learned that it's not a good > > idea to have more than 1 thread accessing libgpiod objects. But this > > raises the question of how to react to events and let reads/writes > > through as quickly as possible at the same time. I have already played > > around with the file descriptor of the request object to interrupt the > > wait for edge events, but this solution is not good because it comes > > at the expense of responsiveness to events, and requires complicated > > synchronization. > > How bad would it be to have 1 thread waiting for events and 1 other > > thread reading/writing? > > > > Regards, > > Mathias > > > > Are you bitbanging? It totally sounds like bitbanging. Have you > considered writing a kernel driver for whatever you're doing? > > Bart