Multiple callback threads?
-
I have been using pi4j for awhile now and everything is working as it should except for one strange thing ... every event creates a new thread and these threads never die? I'm using version 1.2 on a RPi 3B.
The threads should die by themselves after the listener returns (I think) but don't.The project is a pedal operated drum/percussion sample player. You can imagine how the # of threads builds up!
-
That does sound terrible. Events were supposed to use a shared thread-pool. Something must be wrong.
-
Actually i fixed this awhile ago. I was setting up listeners incorrectly. Setting up pin listeners was done in a loop and i think i ended up with one listener on the main thread for all pins.
-
Good to know. Thanks for the update!
-
Actually not sure my explanation is very good or even correct. I did fix it but there was at lot of hacking at the problem. I'll go back to the code and try to clarify exactly what i did wrong and how i fixed it.