Details
-
Bug
-
Resolution: Done
-
P1: Critical
-
4.6.2
-
None
-
None
-
N97, S60 emulator
-
accde4c624fc0fc7a3942925922fc981888c4ac4
Description
Any QT application gets unresponsive on Symbian if OS gets even minor load (some other application running, or socket server receives network traffic).
The problem is in QEventDispatcherSymbian::processEvents, which switches priority to background every 100ms spent in event processing (by the idea, but there is a bug).
1. There is a bug in implementation, when time stamp accrued (time.start) before priority switched to normal. In this case even under minor load task could loose control for indefinite time and when much less than 100ms could be left for event processing. Under heavier loads often happens that task loose control for more than 100ms and only 1 message gets processed before priority gets lowered again.
2. The thread can give up time slice with "sleep(0)" and no need of priority switching. I've tried this (inserted "sleep(0)" after time.start line) and it helped a lot, but still applications were getting unresponsive sometimes.
3. I've tried to remove completely code, that switches priority and gives up CPU time. It produced the best result. QT applications we quite responsive even if another heavy application was working in background.
The problem is easily reproducible in S60 emulator. I've installed rmclock application and tried to slow down my PC CPU with rmclock. At some point QT apps stop working completely in S60 emulator, but other applications were still alive (but slow, of course). After removing priority switching and recompiling QT applications didn't differ from other symnian apps on slowed down S60 emulator.
Why this priority switching code was inserted? It seems all other platforms do not have anything like this.