This variable helps to determine how frequently the program's threads will switch control. After a thread performs the value of DISPLAY_SWITCH_PERIOD display operations, the runtime switches control to another thread (if one exists). Note that because a single DISPLAY statement can compile into multiple display operations, and because thread switching is also affected by other program operations (such as file I/O), it is impossible to predict or control when a thread will change control based on the presence of DISPLAY statements in the source.

By setting DISPLAY_SWITCH_PERIOD to lower values, you cause windows that are updated by multiple threads to update more uniformly, but more time will be spent in the thread switching code. Setting DISPLAY_SWITCH_PERIOD to higher values will decrease the switching overhead, but will also cause the windows to update in blocks. In most cases, applications that use threads will run well with the default setting of 10.