State (computer science)
|
In information processing, a state is the complete set of properties (for example, its energy level, etc. see state (physics)) transmitted by an object to an observer via one or more channels. Any change in the nature or quantity of such properties in a state is detected by an observer and thus a transmission of information occurs.
In computer science, state is a concept in automata theory which occasionally extends into some forms of systems programming such as lexers and parsers.
Whether the automaton in question is a finite state machine, a pushdown automaton or a full-fledged Turing machine, a state is a particular set of instructions which will be executed in response to the machine's input. The state can be thought of as analogous to a practical computer's main memory. the behavior of the system is a function of (a) the definition of the automaton, (b) the input and (c) the current state.
An information system or protocol that relies upon state is said to be stateful. One that does not is said to be stateless. For example, there are stateless firewalls and stateless servers, and HTTP is considered a stateless protocol. A character encoding such as ISO 2022 is said to be stateful if the interpretation of a particular code value depends on the code values that came before it.