Log in / create account | Login with OpenID
DocForge
Programmer's Wiki

Runtime

From DocForge

Runtime describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). The term is also misused as a short form when referring to a runtime library, a program or library of basic code that is used by a particular compiler to manage a program while it is running. Run time and run-time are other ways of expressing the term runtime.

A runtime environment is a virtual machine state which provides software services for processes or programs while a computer is running. It may pertain to the operating system itself, or the software that runs beneath it.

[edit] Implementation Details

In most cases, the operating system handles loading programs with a piece of code called a loader, doing basic memory setup and linking each program with any dynamically linked libraries they reference. In some cases a language or implementation will have these tasks done by the language runtime instead, though this is unusual in mainstream languages on common consumer operating systems.

Some program debugging can only be performed (or are more efficient or accurate) when performed at runtime. Logical errors and array bounds checking are examples. For this reason, some programming bugs are not discovered until the program is tested in a "live" environment with real data, despite sophisticated compile-time checking and pre-release testing. In this case, the end user may encounter a runtime error message.

Early runtime libraries such as that of Fortran provided such features as mathematical operations. Other languages add more sophisticated memory garbage collection, often in association with support for objects.

More recent languages tend to have considerably larger runtimes with considerably more functionality. Many object oriented languages also include a system known as the "dispatcher" and "classloader". The Java Virtual Machine (JVM) is an example of such a runtime: It also interprets or compiles the portable binary Java programs (bytecode) at runtime. The .NET framework is another example of a runtime library.

[edit] Application Errors - Exceptions

Exception handling is one language feature designed to handle runtime errors, providing a structured way to catch completely unexpected situations as well as predictable errors or unusual results without the amount of inline error checking required of languages without it. More recent advancements in runtime engines enable Automated Exception Handling which provides 'root-cause' debug information for every exception of interest and is implemented independent of the source code, by attaching a special software product to the runtime engine.

Example: A program written in Java, would receive services from the Java Runtime Environment by issuing commands from which the expected result is returned by the Java software. By providing these services, the Java software is considered the runtime environment of the program. Both the program and the Java software combined request services from the operating system. The operating system kernel provides services for itself and all processes and software running under its control. The Operating System may be considered as providing a runtime environment for itself.

[edit] See Also


Additional copyright notice: Some content of this page is a derivative work of a Wikipedia article under the GNU FDL. The original article and author information can be found at http://en.wikipedia.org/wiki/Runtime.
Do you have information or insights to contribute to this article? Please feel free to edit this page. Ask questions or contribute to the discussion on this article's talk page.