This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

system_server use too much cpu

I enable the Motion Detection,

It will call function "ApproSetMotion" to send queue message,

The Camera runs about 1days, the system_server will use 50% of CUP. 

I serarch some document about "msgsnd" ,someone say the message queues dead lock.

Help me.Thanks.

int ApproSetMotion(ApproMotionPrm* pMotionPrm)
{
 MSG_BUF msgbuf;
 void* ptr;

 memset(&msgbuf,0,sizeof(msgbuf));
 msgbuf.Des = MSG_TYPE_MSG1;
 msgbuf.Src = PROC_MSG_ID;
 msgbuf.cmd = MSG_CMD_SET_MOTION;
 ptr = (void*)&msgbuf.mem_info;
 memcpy(ptr, pMotionPrm, sizeof(ApproMotionPrm));
 SemWait(hndlApproDrvSem);
 msgsnd( qid,&msgbuf,sizeof(msgbuf)-sizeof(long),0);/*send msg1*/
 msgrcv( qid, &msgbuf,sizeof(msgbuf)-sizeof(long), PROC_MSG_ID, 0);
 SemRelease(hndlApproDrvSem);
 return msgbuf.ret;
}