Chapter 4. Events

The Windows 95 virtual machine manager (VMM) is a multiple threaded, non-reentrant operating system. Because it is non-reentrant, virtual devices (VxDs) that process hardware interrupts must have some method of synchronizing their calls to the VMM. For this reason, Windows 95 has the concept of "event" processing.

Events are requests from VxDs that a callback procedure be called at a more propitious time. An event is made of the following pieces of information:

If one of the prerequisites for an event is that it be called when the current virtual machine or current thread is a particular thread, it is said that the event is scheduled 'for' that thread or virtual machine. The act of calling the event callback procedure is referred to as 'processing' the event.

When a VxD is entered because of an asynchronous interrupt such as a hardware interrupt, the VxD can call only a small subset of services. The VxD can:

Devices that service hardware interrupts often need to use services other than those referred to above. When this is the case, the VxD must schedule an event. That is, the VxD calls an event service such as Schedule_VM_Event, specifying a callback function that the VMM calls when it is safe to call synchronous services.

You can schedule global events or events that a specific to a VM or thread. The callback function for a global event may be called at any time. However, a VM event callback function is always called with the specified VM as the current VM. Similarly a thread event callback function is always called with the specified thread as the current thread.

Certain services can only be called if no VM owns the critical section. To schedule an event such that the callback function is only called when the critical section is not owned, you can use the Call_Restricted_Event service with the PEF_WAIT_NOT_CRIT flag. You can schedule a critical section callback function by using the Call_When_Not_Critical service. For more information about critical sections, see Synchronization.

VM events are often useful for virtual devices that do not service hardware interrupts and can be scheduled at any time except during a Non-Maskable Interrupt (NMI).

Restricted events, which are the most general type of event, are new for Windows 95. When scheduling a restricted event, you can specify a number of "restrictions", or conditions that must be met before the event callback will be called.

Services whose names are of the form Call_XX_Event have the option either to schedule an event or to call the event callback procedure immediately without scheduling an event. The event will be scheduled if the VMM is processing a hardware interrupt that interrupted the VMM, or if the event is virtual machine-specific or thread-specific and the requested virtual machine or thread is not the current virtual machine or thread. The event will also be scheduled if the PEF_ALWAYS_SCHED bit is set, assuming the service supports such a bit. (Not all do.) This list of conditions is intended to be informative and not comprehensive. The VMM reserves the right to choose to schedule the event under conditions not explicitly listed above.

See Also

Call_Priority_VM_Event, Call_When_Not_Critical, Call_Restricted_Event