Runtime
Runtime refers to events that occur while a program is executing (running). Runtime programming enables the logical occurrence of such events during the execution of an application, without having to go through time-consuming and error-prone cycles of the compilation of code and the execution of the compiled code.
When a program is executed, space is made available and the main function of the program is copied into memory as a sequence of executable statements. The space is called the runtime stack. At first the runtime stack is empty. But, as a particular function is called during program loading, the called function is also copied into the stack. The stack fills up with copies of required functions. Runtime creates virtual processors--virtual mini-processing units. These schedule the order of execution of the copied functions. As each function is executed, the copy of that function that was made is removed from the runtime stack. At the conclusion of loading of the program the runtime stack is empty.
Runtime error and runtime library are several runtime-associated events. A second runtime event is called the runtime library. This is a library of routines that are committed to a program during its execution.
Runtime events are operative in all operating systems, and in many programs running in these systems. So, too, are runtime errors. A runtime error is generally an error that occurs during the execution of a program. Something needed to run the program is not working properly. As a result, the program fails to execute. Common causes of a runtime error are running out of memory, of a bug in the program software or something that blocks the executing program, such as another program.
There are dozens of possible runtime errors. General system errors can also occur, as well as more specific errors:
- I/O system errors
- file system errors
- disk, serial ports, clock specific errors
- storage allocator errors
- resource manager errors
- scrap manager errors.
The underlying causes of the errors are numerous. The following are only a few examples:
- unimplemented core routine
- read error
- write error
- driver not found
- directory full
- disk full
- file not found
- file system error during rename
- drive not installed
- unable to correctly adjust disk speed
- resource file not found.
A malicious cause of runtime errors in the Windows operating system is infection with a virus known as a Trojan Horse program, specifically with species called "SubSeven" or "Backdoor." These viruses, typically transmitted as an attached file to an e-mail message, are especially insidious as they act as a conduit for the unauthorized entry of another user to the host computer. Typical viral signature files are "msrexe.exe," "run.exe," windos.exe," and "mueexe.exe."
Another runtime feature in object-oriented languages such as Java is the runtime interface. The interface serves a number of functions, including servicing applications that use the runtime to facilitate their functioning. An example of these applications is a mini-program called an applet that runs within another program. Debugging programs also utilize the runtime interface. In essence the runtime interface is a buffer between an application and the operating platform--the application thus need not to tied to the platform in terms of development or revision. This allows native code to continue to operate even when classes are revised.
A runtime library is a convenient collection of functions that can be invoked during the running of a program. After the program is completed, the functions are available to be used with another program. Like the other runtime aspects, the runtime library is ubiquitous in operating systems and many programs. The choice of functions in a library is vast. For example, the Free C Runtime Library, which is used in Windows operating systems, has over 100 commands, specifying file manipulation functions, data conversion functions, memory manipulation functions, mathematical functions, and more. The following few examples give a flavor for the options available:
- fgetc -- reads a character from a stream
- fputchar -- writes a character to stdout
- getc -- gets a character from a stream
- putchar -- writes a character to stdout
- remove -- deletes a file
- access -- determines file access permission
- close -- closes a file
- labs -- absolute value of log
- free -- free memory block
- malloc -- allocate memory block
- strcmp -- compare two strings
- strstr -- find the first occurrence of a string in another string.
This is the complete article, containing 685 words
(approx. 2 pages at 300 words per page).