why the system is dead?

when I ran my GUI programme under qnx,sometimes when I click the mouse or move the mouse,the programme is dead and shows cpu occuption is 100%,but next time when I do the same thing,the system is ok,why and how to avoid it?

Your program is dead or the whole system is dead? I suspect you have bug in your program. :slight_smile: More than likely a bad pointer, given it is running ready.

A useful tool I use for catching memory problems is eFence. You can find a link for it someone on this site. It will cause your program to SEGV when the problem occurs which makes it easy to see in the debugger.

sometimes my programme needs to allocate memory to read a very large file more than 60M, I want to if I should reduce the priority of the GUI programme to avoid interrput other programme.

That is a hard question to know without knowing how your complete system works. I hope you aren’t allocating 60M of memory to do this. If you are, you need to take a hard look at your design.

In general, don’t mess with the priorities unless you have to - and in a lot of cases, you can design it such that it is not necessary. Usually if you do mess with priorities, it doesn’t work the way you expect it to.