Skip navigation.
Home
The QNX Community Portal

View topic - Application hangs issue in QNX6

Application hangs issue in QNX6

Discussion about the general applications that run on QNX6

Application hangs issue in QNX6

Postby hello » Thu Mar 21, 2013 3:28 pm

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
hello
Senior Member
 
Posts: 101
Joined: Tue May 08, 2012 1:09 pm

Re: Application hangs issue in QNX6

Postby maschoen » Thu Mar 21, 2013 4:35 pm

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.
maschoen
QNX Master
 
Posts: 2644
Joined: Wed Jun 25, 2003 5:18 pm

Re: Application hangs issue in QNX6

Postby mario » Thu Mar 21, 2013 8:17 pm

Yes it could if another thread does a PtEnter() but never does the corresponding PtLeave()
mario
QNX Master
 
Posts: 4132
Joined: Sun Sep 01, 2002 1:04 am

Re: Application hangs issue in QNX6

Postby hello » Wed Mar 27, 2013 10:11 am

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
hello
Senior Member
 
Posts: 101
Joined: Tue May 08, 2012 1:09 pm

Re: Application hangs issue in QNX6

Postby Tim » Wed Mar 27, 2013 5:02 pm

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
Tim
Senior Member
 
Posts: 1390
Joined: Wed Mar 10, 2004 12:28 am

Re: Application hangs issue in QNX6

Postby redmond1 » Wed Mar 27, 2013 7:45 pm

Are you using 6.3? Any code to change the text color or font size?
redmond1
New Member
 
Posts: 1
Joined: Wed Aug 04, 2010 4:46 pm


Return to QNX6 - Applications

Who is online

Users browsing this forum: No registered users and 1 guest