Using pthread and message queue with QProcess : problem



  • this is just the outline of my problem .

    please can somebody provide some solution.
    @
    int main()
    {
    Mainwindow w;
    }

    Mainwindow :: Mainwindow()
    {
    call_actions();

    }

    call_actions()
    {
    QProcess *newproc1 = QProcess;

    pthread_create(tid,NULL,wait_for_message_from_appl,NULL);
    }
    int msgid;
    int key = 0x1234;

    void * wait_for_message_from_appl ( void *)
    {

    msgget(msgid);
    msgrcv(msgid,msg);
    if (msg == appl1)
    launch(app1);
    }

    launch(app1)
    {
    QProcess *newproc2 = QProcess;

         msgrcv(msgid); // this is failing saying Interrupted system call
    

    wait_for_exit();// this will come from newproc2 , i will send msg

    }@


    interface_file.c (newproc1 process)
    @
    msgid = msgget(0x1234);
    msgsnd(app1); -- will go to wait_for_message_from_appl@

    applicaion_file.c (newproc2process)
    @ if(exit)
    msgid = msgget(0x1234);
    msgsnd(msgid,"exit");//----- this shoud go to newproc2@

    the second time i use msgrcv ( in newproc2) i am getting msg saying "Interrupted system call".

    what is problem.

    please suggest me some other way by which i can achieve the same (my design skills are really poor)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.