Wait for "signal" from another application and/or thread

zoom
Date: 09/12/04


Date: Mon, 13 Sep 2004 02:43:00 +1000

Assume that we have two applications running on the same PC each with two
threads.

Application-1, Thread-1 :
       . . .
       while(!Terminated && !MYSIGNAL) {
            //?? How to implement following line ??
            wait for MYSIGNAL
           ...
       }

Application-1, Thread-2 :
       . . .
       while(!Terminated ) {
           if (Some Condition) {
              //?? How to implement following line ??
             raise MYSIGNAL
          }
           ...
       }

Application-2, Thread-1 :
       . . .
       while(!Terminated && !MYSIGNAL) {
            //?? How to implement following line ??
            wait for MYSIGNAL for 200millisecond
             if (MYSIGNAL)
                Do this..
             else
                Do that..
           ...
       }

Application-2, Thread-2 :
       . . .
       while(!Terminated ) {
           if (Some Condition) {
              //?? How to implement following line ??
             raise MYSIGNAL
          }
           ...
       }