I have wrote a qt program running with multithreading on uClinux. I run only one extra thread other than the main one. But the pushbutton really lags and sometimes stop responding. Please tell me if BF548 process suits for multithreaded programs? Or its just the coding problem? Note that I can run the same code on PC smoothly..
If you disable your slave thread, do you get better performance on your pushbutton?
What are you doing in the slave thread? How much cpu time do it consume?
It does have better performance on the pushbuttons when disabling the slave thread. But I need the thread.
I am doing building a GUI for pocketsphinx speech recognition API. When the button is pushed, it starts recording speech in PCM (signed 16 bits, 16 kHz, 32 frames and mono channel). I am running the recorder in the slave thread. So I can stop recording when I want to.
It takes about twice of the time after I release the pushbutton. If I release the recording button quickly, it stops after a few seconds. If I hold the button for about 5 seconds, it stops at the 10th seconds. Record over 10 seconds will crash the program..
I've two thoughts about this issue:
1) are you able to identify where the cause of the lag is, could it about the CPU performance? for example, when running on PC, run top to check how much the CPU time it consumes, and what's the CPU modle and total CPU capability on the PC?
2)Usually the man machine interaction thread should be of the high priority, have you tried lowering the priority of the slave thread for data processing?