View topic - Application hangs issue in QNX6

Page 1 of 1

Application hangs issue in QNX6

PostPosted: Thu Mar 21, 2013 3:28 pm
by hello
Hi all,

I have an application with 3 threads which updates the GUI in parallel. In some cases, 3 threads will try to update the GUI at the same time.
Before each GUI update, PtEnter() and PtLeave() is used. Is there any possiblity of application hang in such a situation ? Please help

Regards,
hello

Re: Application hangs issue in QNX6

PostPosted: Thu Mar 21, 2013 4:35 pm
by maschoen
This is the correct way to have multiple threads update the GUI. It should not cause the application to hang.
If you are overly concerned, you could change your structure so that two of the threads merely send messages to the first, and only the first does GUI updates. This is unlikely to cause any visible impact.

Re: Application hangs issue in QNX6

PostPosted: Thu Mar 21, 2013 8:17 pm
by mario
Yes it could if another thread does a PtEnter() but never does the corresponding PtLeave()

Re: Application hangs issue in QNX6

PostPosted: Wed Mar 27, 2013 10:11 am
by hello
Hi all,

I have an application which needs to update log to GUI continuously. I used PtMultiText widget for this purpose. But when i run the program continuously, the application becomes hangs. PtMultiTextModifyText() API is used to send logs to GUI.

Is there any method to know whether the PtMultiTextModifyText() has successfully updated the GUI. I have ensured that PtEnter() and PtLeave() calls are used correctly.

PtEnter()/PtLeave() code snippet used

int flags = PtEnter(0);
if ((flags >= 0) || (flags == -EDEADLK))
{
some GUI updates
if (flags >= 0)
{
PtLeave(flags);
}
}

Regards,
hello

Re: Application hangs issue in QNX6

PostPosted: Wed Mar 27, 2013 5:02 pm
by Tim
We'd need to see/know more about the other threads and what happens in the 'GUI Updates' code.

For example if in the 'GUI updates' code, it attempts to acquire a different mutex that is held by one of the other GUI threads that is itself blocked on the PtEnter() call you've got a system deadlock.

Another possibility if you are writing in C++ is that an exception was thrown in the 'GUI Updates' code and kicked you out of the PtEnter block in which case you'd never hit the PtLeave call.

There are probably other possibilities. Hence the need to see the code or know more about your GUI threads.

Tim

Re: Application hangs issue in QNX6

PostPosted: Wed Mar 27, 2013 7:45 pm
by redmond1
Are you using 6.3? Any code to change the text color or font size?