An event flag is a process synchronization primitive in the OpenVMS operating system. It has two possible states, set or cleared. The following basic primitive operations are provided:
- Set event flag ($SETEF)
- Clear event flag ($CLREF)
- Wait for event flag ($WAITFR)--if the flag was clear, this would make the process wait until it was set. If the flag was already set, this would immediately return, leaving the flag set.
Additional synchronization operations are:
- $WFLOR--wait for any of the specified event flags to be set.
- $WFLAND--wait for all the specified event flags to be set.
Event flags can be either local (per-process) or common (accessible by more than one process). Each process has its own set of 64 local flags, numbered 0-63. It is also possible to associate the process with up to 2 sets of common event flags. These come in sets of 32 each, and the process can assign them numbers 64-95 or 96-127. They come into existence when the first process associates with them, and disappear when the last process removes its association.
Every potentially time-consuming asynchronous system call (QIO among others) includes an argument specifying the number of an event flag to set on completion.
Compare semaphore.
Famous quotes containing the words event and/or flag:
“All the philosophy, therefore, in the world, and all the religion, which is nothing but a species of philosophy, will never be able to carry us beyond the usual course of experience, or give us measures of conduct and behaviour different from those which are furnished by reflections on common life. No new fact can ever be inferred from the religious hypothesis; no event foreseen or foretold; no reward or punishment expected or dreaded, beyond what is already known by practice and observation.”
—David Hume (17111776)
“Swift blazing flag of the regiment,
Eagle with crest of red and gold,
These men were born to drill and die.
Point for them the virtue of slaughter,
Make plain to them the excellence of killing
And a field where a thousand corpses lie.”
—Stephen Crane (18711900)