I have just started working with the GPIO library and I would like to have a clarification on the way the library works. It's about the usage of add_event_detect when a callback function is used. From the examples I've seen I understand that if one wants to use a callback function the main thread must run forever hence there is a
statement at the end. What I do not understand is why this is usually followed by a
statement. Since sleep() causes the program execution to pause how can the callbacks keep getting triggered (e.g from a sensor event or button press?).Are the callbacks triggered independently of the main thread?