Hello Every body,
We are using unix curses function for screen development.
One of our program calls "refresh()" function.
After the call to refresh(), the screen hangs displaying massage passed "RECEIVING IN PROGRESS" and slowly CPU usage increses and bocomes 95% for the process. The message does not disappear eventhough refresh() function is called.
We were to kill the process and rerun the process. Then it went fine. This is happening at times, approximately once in six months.
The main area of code is copied under:
We are 100% sure that there is no problem with the other part of the logic. This application is running for the past ten years. This application is developed in Unix/C and running in DEC Alpha.
Please help us in solving this occassionally happening problem.
Thanks a lot,
Dakshin
We are using unix curses function for screen development.
One of our program calls "refresh()" function.
After the call to refresh(), the screen hangs displaying massage passed "RECEIVING IN PROGRESS" and slowly CPU usage increses and bocomes 95% for the process. The message does not disappear eventhough refresh() function is called.
We were to kill the process and rerun the process. Then it went fine. This is happening at times, approximately once in six months.
The main area of code is copied under:
Code:
..
..
#include <curses.h
..
..
..
void receive(RCV *qrcv, int tag_print_cnt, BOOL spw_flag, const char condition_code)
{
//
// some declaration goes here
//
// some initialization goes here
// some logic goes here
i = 0;
while (i LT num_tags) /*----THE BIG LOOP----*/
{
// some initialization goes here
clrerrl(); // definition is given below
prntmsg("RECEIVING IN PROGRESS...."); // definition is given below
refresh(); // One more call to refresh()
if(Bool)
{
// some logic goes here
}
do
{
}while(some condition)
if(Bool)
{
// some logic goes here
}
} // end of while
} // end of function
clrerrl () function definition:
void clrerrl()
{
move(ERROR_LINE, 0);
clrtoeol();
refresh();
}
prntmsg("String”) function definition:
void prntmsg(const char *message)
{
int y, x;
getyx(stdscr, y, x);
move(ERROR_LINE, 0);
clrtoeol();
beep();
addstr((char *)message);
move(y, x);
refresh();
}
We are 100% sure that there is no problem with the other part of the logic. This application is running for the past ten years. This application is developed in Unix/C and running in DEC Alpha.
Please help us in solving this occassionally happening problem.
Thanks a lot,
Dakshin