# Event Processing and Multithreading

In general, LabWindows/CVI invokes user interface callbacks in the same thread in which you create the panel or menu bar to which the callback event applies. This applies to all controls on a panel, including timer controls. The following exceptions exist:

- DiscardCtrl invokes the control callback with the EVENT_DISCARD message. You can call DiscardCtrl in any thread.
- For the EVENT_IDLE message, LabWindows/CVI invokes the main callback in the thread in which you call InstallMainCallback.

| Note Additionally, for events that are associated with a panel, you must process events in the same thread in which you create the panel.