DevHelp TCYield

From EDM2
Jump to: navigation, search

This service is similar to the DevHlp_Yield, except that TCYield yields the CPU only to a time-critical thread if one is available.

Syntax

C

USHORT APIENTRY DevHelp_TCYield()

Assembler

MOV   DL,DevHlp_TCYield

CALL  [Device_Help]

Parameters

C

None.

Assembler

None .

Return Code

C

Success Indicator: None.

Possible errors: None.

Assembler

None .

Remarks

This function is a subset of the Yield function; it is not necessary for the physical device driver to do both a Yield and a TCYield. Physical device drivers, particularly those that perform program I/O on long strings of data or that poll a device, are the one part of the kernel that can use a large amount of time in the CPU. These physical device drivers should periodically check the TCYield flag and call the TCYield function to yield the CPU to a time-critical thread. The location of the TCYield flag is obtained from a call to GetDOSVar. For performance reasons, the physical device driver checks the TCYield Flag once every 3 milliseconds. If the flag is set, then the physical device driver calls TCYield. Because the physical device driver can relinquish control of the CPU, it should not assume that the state of the interrupt flag is preserved across a call to TCYield.

Example Code

C

#include  "dhcalls.h"

USHORT APIENTRY DevHelp_TCYield()

Related Functions