Closed WebsterXC closed 7 years ago
Changing our Bluetooth code implementation helped our data gathering speed significantly. This issue is no longer required as it was solved instead by collecting a fixed 64 chars at a time each time a PID is requested, rather than read the return buffer character by character as we had been doing before.
After troubleshooting and reviewing our current code, I'm convinced we're being restricted by Python's global interpreter lock (GIL) combined with my threading implementation.
Switching to multiprocessing will require a lot of extra code, but I feel it may really help our data gathering. Although I/O bound tasks in Python do not use the GIL, the underlying OS does not see our Bluetooth socket as an I/O syscall, and does not release the GIL when pinging the dongle.