Hi I am using Serial port communication to one of my device using python codes. It is sending a set of Hex code, Receives a set of data. process it.
This data has to be stored in to a database.
I have another script that has MYSQLdb library pushing it in to the database.
If I do that in sequentially in one script i lose a lot in sampling rate. I can sample up to 32 data sets per second if I dont connect to a database and insert it in to the table.
If I use Multiprocessing and try to run it my sampling rate goes to 0.75, because the parent process is waiting for the child to join. so how can i handle this situation.
Is it possible to run them independently by using a queue to fill data?
Use threading and Queue.
here is an example: