## Physical Device Driver Reference

[prev][next][parent][TOC]

### Performance

The performance of a character device driver with respect to its monitor chains can be affected by several factors:

Performance can be degraded when interrupts are disabled too long. When a monitor chain is empty, a character device driver can place data directly into its monitor chain buffer by calling MonWrite. The monitor dispatcher disables interrupts, writes the data into the monitor chain buffer, calls the device driver's notification routine, and re-enables interrupts when the physical device driver returns to the monitor dispatcher. If the physical device driver fails to quickly process the data placed into its monitor chain buffer quickly, interrupts can be disabled too long.

The monitor dispatcher must guarantee that the data placed into the device driver's monitor chain buffer during a call to MonWrite is processed before new data can be placed into the buffer on subsequent calls. Because there is no shared semaphore or other means of signalling between the monitor dispatcher and the physical device driver to protect this data area from being overwritten, the monitor dispatcher protects the data in the buffer by disabling interrupts until the device driver has processed the data.

Performance can be improved by increasing the size of the physical device driver's monitor chain buffer. Because the size of this buffer determines the size of all monitor buffers in a monitor chain, performance is improved during calls to MonWrite to place data into the monitor chain. Performance is also improved during DosMonRead and DosMonWrite monitor function calls that intercept and return data to the data stream. As the size of the buffers increase, fewer blockages occur.

Note: When increasing a published size of a device driver's monitor chain buffer, there is a danger of preventing existing monitors from successful monitor registration because the size of the monitor's private data area is based on the size of the device driver's monitor chain buffer.