title: Python: Send incoming serial data to MySQL
body: <p>I am trying to write a simple <strong>python</strong> script that will read incoming serial data (usb adaptor) at 115200. After each line is received it must upload it to MySQL running in a Synology NAS in the same network.</p>
  
  <p>The problem I see with the <strong>mysql INSERT</strong> from within python is that it can take from 0,5 seconds to 1,3 seconds and during this time any incoming messages would be lost, probably several ones.</p>
  
  <p>I have tried many <strong>threading</strong> options codes but cant get it to work as normally example codes show you how to run 1, 2 or 3 threads at the same time, but what I need is to create threads as they are required by the incoming data.</p>
  
  <p>btw: Using Raspberry Pi.</p>
  
  <p>As a reference, some of the examples I have tried:
  <a href="http://www.tutorialspoint.com/python/python_multithreading.htm" rel="nofollow">http://www.tutorialspoint.com/python/python_multithreading.htm</a> </p>