## Physical Device Driver Reference

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

### Task Synchronization

Semaphores can be used to synchronize and serialize the separate tasks of taking data from the data stream, filtering the data, and returning the filtered data to the data stream. For example, a monitor thread that has completed a call to DosMonRead can signal another monitor thread to filter the data. This second thread, having filtered the data, can signal a third monitor thread that the filtered data can be returned to the data stream by calling DosMonWrite. The third thread, having called DosMonWrite, can signal the first thread that it can take more data from the data stream.

Note: To avoid a severe and permanent impact to the data stream, the application must take special care that its monitor threads do not wait on semaphores cleared by outside events (for example, waiting for I/O).