I wish to use SQLite for my GUI Python application but I must update database every 500 MS without effecting the performance of my program.
I am using PyQt4,And So I considered using QThread however it appears difficult to cope with, and so i wondered whether it was the easiest way before really attempting to comprehend it.
My Real question is: is QThread the easiest way or you will find different ways?
According that python implementation depend around the GIL, despite using threads or timer you will not have the ability to make a move (potentially pricey) inside your program without effecting the worldwide performance from the program.
I'll suggest you to definitely take a look to multiprocessing module to obtain around of the limitation. By using this module, you'll forget about use threads (that are influenced by the GIL), but processes (not impacted by GIL).
You may could produce a subprocess which will arm a timer to create the update every 500ms once the primary process continues his job.
Then, you'll allow the system get the job done of balancing the programs also it might be better in term of responsiveness (particularly in a multi core atmosphere)