Skip to content

Commit

Permalink
update readme (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-kaufman authored Apr 24, 2018
1 parent b93d2aa commit a2b4c32
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ execution, "what was the path of asynchronous functions that got me here"?
## Terminology
One of the key challenges with "asynchronous context" is the lack of agreed upon terminology and semantics. Let's define some:

1. `Execution Frame` - An `Execution Frame` is a period of program execution, defined precisely as the period of time that a special function, called a `Continuation`, is executing. At a lower level of abstraction, you can think of an `Execution Frame` as the period of time from when specific call frame is pushed on the stack, until that call frame is unwound off of the stack. Not all functions are `Continuations` (more on that below).
1. `Execution Frame` - An `Execution Frame` is a period of program execution, defined precisely as the period of time that a special function, called a `Continuation`, is executing. At a lower level of abstraction, you can think of an `Execution Frame` as the period of time from when specific call frame is pushed on the stack, until that call frame is unwound off of the stack. Not all functions are `Continuations` (more on that below). A specific instance of a `Continuation` can be invoked multiple times; each invocation corresponds to a unique `Execution Frame`.

2. `Continuation` - A `Continuation` is a JavaScript function created in one `Execution Frame` and passed to a host library to be invoked later. Upon invocation, a `Continuation` creates a new unique `Execution Frame`. For example, when we call `setTimeout(function c() {}, 1000)`, `setTimeout` is invoked in one `Execution Frame`, with the caller passing a `Continution` (namely `c`) as a parameter. When `c` is invoked after the timeout period, a new `Execution Frame` is created, and when `c` completes, that `Execution Frame` is completed.

Expand Down

0 comments on commit a2b4c32

Please sign in to comment.