Path: utzoo!attcan!uunet!wyse!vsi1!ames!pasteur!ucbvax!CITHEX.CALTECH.EDU!carl From: carl@CITHEX.CALTECH.EDU (Carl J Lydick) Newsgroups: comp.os.vms Subject: Re: Event flags and AST Message-ID: <880724121644.144e@CitHex.Caltech.Edu> Date: 24 Jul 88 19:21:50 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 28 > I am stuck with the following problem and I think that I am > overlooking something. Part one of my problem was rather easy, > problem is really with part 2. Here it comes: > > 1. I needed to "synchronize" the running of several processes. Those > processes were SPAWNed from different accounts IN THE SAME GROUP. It > was easy enough to create a (temporary) event flag cluster that all > these processes shared and make 'em all wait for a specific event > flag. I did this using two very simple programs that I called WAIT > and SIGNAL. Essentially when SIGNAL is run, the WAIT program quits > running (the event flag is set). > 2. What I need to do is the following: > I need to declare an AST routine in a program. The AST routine > should be called when (preferably) an event flag is set. Problem is I > could not find a way to let the program run - apparently you must > WAIT for the event flag to be set. I need to let the program run and > be interrupted by an event flag being set. I don't know how to solve part 2 given that you're using the mechanism of part 1. However, depending on how close the synchronization needs to be, I have a suggestion for another way of doing things: You could set up mailboxes for each process to be synchronized, and instead of using event flags, have each process issue a $QIO to its mailbox with your AST routine as the completion AST routine. Make sure the AST routine queues another I/O request to the mailbox. Then have the process that would have set the event flag write to each of the mailboxes instead.