Execution model: Difference between revisions

Content deleted Content added
Seanhalle (talk | contribs)
No edit summary
Seanhalle (talk | contribs)
No edit summary
Line 1:
{{Program execution}}
 
An '''execution model''' specifies how work takes place. Every programming language has an execution model, which is specified as part of the language specification, and is implemented as part of the language implementation. Execution models can also exist independently from programming languages, an example of which would be the [[PosixPOSIX Threads]] library. The details in the specification of an execution model cover things such as what is an indivisible unit of work and what are the constraints on the order in which those units of work take place. For example, the addition operation is an indivisible unit of work in many languages, and in sequential languages such units of work are constrained to take place one after the other.
 
In particular, the [[C (programming language)|C programming language]], defines statements, which are terminated by a ";". This can be viewed as defining one level of indivisible unit of work. The language spec goes on to say that statements proceed in-order. This can be viewed as defining constraints on the order of performing those units of work. It also specifies the order of precedence, which can be viewed as defining another level of indivisible work unit, while at the same time stating the constraints on the order of performing those work units. So, order of precedence covers constraints on work within a statement, and ";" covers constraints on the order of those statements.