resource show_sig_drv() import show_sig_dis process sleepers (i := 1 to 3) nap(i*1000) write("Process", i, "wants to enter monitor sleep proc at time", age()) show_sig_dis.sleep(i) write("Process", i, "done at time", age()) end process waker nap(2500) write("Process 9 wants to enter monitor wake proc at time", age()) show_sig_dis.wake(9) write("Process 9 done at time", age()) end end /* ............... Example compile and run(s) % m2sr -sx show_sig_dis.m % sr -o show_sig show_sig_dis.sr show_sig_drv.sr show_sig_dis.sr: show_sig_drv.sr: show_sig_dis.sr: show_sig_drv.sr: linking: % ./show_sig Process 1 wants to enter monitor sleep proc at time 1073 Process 1 enters monitor sleep proc at time 1079 Process 1 queues on c.v. sleep proc at time 1184 Process 2 wants to enter monitor sleep proc at time 2073 Process 2 enters monitor sleep proc at time 2076 Process 2 queues on c.v. sleep proc at time 2183 Process 9 wants to enter monitor wake proc at time 2583 Process 9 enters monitor wake proc at time 2588 Process 3 wants to enter monitor sleep proc at time 3073 Process 9 signals c.v in wake proc at time 3593 Process 9 done at time 3597 Process 1 awakes on c.v. sleep proc at time 3598 Process 1 leaves monitor sleep proc at time 3703 Process 1 done at time 3705 Process 3 enters monitor sleep proc at time 3706 Process 3 queues on c.v. sleep proc at time 3813 RTS warning: blocked process: show_sig_dis.sleep : file show_sig_dis.sr, line 67 RTS warning: blocked process: show_sig_dis.sleep : file show_sig_dis.sr, line 67 % m2sr -sc show_sig_dis.m % sr -o show_sig show_sig_dis.sr show_sig_drv.sr show_sig_dis.sr: show_sig_drv.sr: show_sig_dis.sr: show_sig_drv.sr: linking: % ./show_sig Process 1 wants to enter monitor sleep proc at time 1078 Process 1 enters monitor sleep proc at time 1084 Process 1 queues on c.v. sleep proc at time 1188 Process 2 wants to enter monitor sleep proc at time 2078 Process 2 enters monitor sleep proc at time 2081 Process 2 queues on c.v. sleep proc at time 2188 Process 9 wants to enter monitor wake proc at time 2578 Process 9 enters monitor wake proc at time 2581 Process 3 wants to enter monitor sleep proc at time 3078 Process 9 signals c.v in wake proc at time 3588 Process 9 continues in wake proc at time 3592 Process 9 signal two! in wake proc at time 3698 Process 9 leaves monitor wake proc at time 3808 Process 9 done at time 3810 Process 3 enters monitor sleep proc at time 3811 Process 3 queues on c.v. sleep proc at time 3918 Process 1 awakes on c.v. sleep proc at time 3921 Process 1 leaves monitor sleep proc at time 4028 Process 1 done at time 4030 Process 2 awakes on c.v. sleep proc at time 4032 Process 2 leaves monitor sleep proc at time 4138 Process 2 done at time 4140 RTS warning: blocked process: show_sig_dis.sleep : file show_sig_dis.sr, line 65 */