$SynchronousEvaluation

$SynchronousEvaluation

is a symbol whose value is True if it is evaluated as part of a synchronous evaluation.

Details

  • A synchronous evaluation is generally triggered by controls in the front end. Controls that may generate synchronous evaluations include Button, EventHandler, and any control that takes a Dynamic value.
  • Manipulate may trigger synchronous evaluations, depending upon the value of the SynchronousUpdating and SynchronousInitialization options.
  • A synchronous evaluation is the same as a preemptive evaluation. Some controls, such as Button and EventHandler, support an option setting of Method->"Preemptive", which causes the control's evaluations to be synchronous.
  • Synchronous evaluations halt the system while being evaluated. A typical use of $SynchronousEvaluation is to write code that should behave differently to prevent halting the system excessively.

Examples

open allclose all

Basic Examples  (2)

Typical shift-return evaluations are asynchronous:

In[1]:=
Click for copyable input
Out[1]=

Evaluations within Dynamic are synchronous by default:

In[1]:=
Click for copyable input
Out[1]=

Scope  (2)

Properties & Relations  (3)

See Also

SynchronousUpdating  SynchronousInitialization  PreemptProtect  $DynamicEvaluation  ControlActive

Tutorials

Introduced in 2015
(10.3)