Hi I am connection to application using dbus.
One application is using gui. and another one is non-gui application.
I am sending touch events(i.e click event, focus event) from gui application to non-gui application using dbus.
I am able to get events from gui to non-gui application.
But I am having few other critical task(dsp hpi communication etc) to call from non-gui application and i cant spend 1ms each time to call QCoreApplication::ProcessEvents(QEventLoop::AllEve nts,1);
so my code is as below,
while(1)
{
/* setTimer(20); // timer overflow will set this flag on every 20msec
if(g20MsecTimer == TRUE)
{
// I am calling process event task on every 20 msec
QCoreApplication::ProcessEvents(QEventLoop::AllEvents,1);
g20MsecTimer = FLASE;
}
dsptask();
//few other task ...
}
while(1)
{
/* setTimer(20); // timer overflow will set this flag on every 20msec
if(g20MsecTimer == TRUE)
{
// I am calling process event task on every 20 msec
QCoreApplication::ProcessEvents(QEventLoop::AllEvents,1);
g20MsecTimer = FLASE;
}
dsptask();
//few other task ...
}
To copy to clipboard, switch view to plain text mode
this result in a very long response time arount 5 to 10 seconds and gui gets freeze for this period.
Can anybody suggest any solution to process event eventually without getting gui freeze
But if I use below code gui works fine, but i cant afford it because i dont know how much exact time will qt take to process events.
while(1)
{
dsptask();
//few other task ...
}
while(1)
{
QCoreApplication::ProcessEvents(QEventLoop::AllEvents,1);
dsptask();
//few other task ...
}
To copy to clipboard, switch view to plain text mode
Bookmarks