Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Using pthread and message queue with QProcess : problem

    General and Desktop
    1
    1
    1317
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      Dcqt last edited by

      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)

      1 Reply Last reply Reply Quote 0
      • First post
        Last post