Register an operating system-level handler. If so, it calls the Xt-level callback function. The following program demonstrates asynchronous input handlers. Because the X Toolkit event loop is not preemptive, its semantics are slightly different from those of asynchronous signals. See the X Toolkit manual for information on some possible problem areas.
Most interactive programs spend most of their time waiting for user and system input.
The X Toolkit event loop simply blocks and waits when it has nothing else to do. If you wish, you may take advantage of this dead time with work procedures. If there is any user or system input to process, the X Toolkit event loop processes it normally. If there is no input to process, the event loop will execute your work procedure. Work procedures are a convenient way to execute small pieces of code without blocking your user interface.