Active objects
Encyclopedia
An active object framework is a callback
Callback (computer science)
In computer programming, a callback is a reference to executable code, or a piece of executable code, that is passed as an argument to other code. This allows a lower-level software layer to call a subroutine defined in a higher-level layer....

-based form of multitasking
Computer multitasking
In computing, multitasking is a method where multiple tasks, also known as processes, share common processing resources such as a CPU. In the case of a computer with a single CPU, only one task is said to be running at any point in time, meaning that the CPU is actively executing instructions for...

 for computer systems. Specifically, it is a form of cooperative multitasking and is an important feature of the Symbian
Symbian
Symbian is a mobile operating system and computing platform designed for smartphones and currently maintained by Accenture. The Symbian platform is the successor to Symbian OS and Nokia Series 60; unlike Symbian OS, which needed an additional user interface system, Symbian includes a user...

 operating system.

Within the framework, active objects
Object (computer science)
In computer science, an object is any entity that can be manipulated by the commands of a programming language, such as a value, variable, function, or data structure...

 may make requests of asynchronous services (e.g. sending an SMS
Short message service
Short Message Service is a text messaging service component of phone, web, or mobile communication systems, using standardized communications protocols that allow the exchange of short text messages between fixed line or mobile phone devices...

 message). When an asynchronous request is made, control is returned to the calling object immediately (i.e. without waiting for the call to complete). The caller may choose to do other things before it returns control back to the operating system, which typically schedules other tasks or puts the machine to sleep. When it makes the request, the calling object includes a reference to itself.

When the asynchronous task completes, the operating system
Operating system
An operating system is a set of programs that manage computer hardware resources and provide common services for application software. The operating system is the most important type of system software in a computer system...

 identifies the thread
Thread (computer science)
In computer science, a thread of execution is the smallest unit of processing that can be scheduled by an operating system. The implementation of threads and processes differs from one operating system to another, but in most cases, a thread is contained inside a process...

 containing the requesting active object, and wakes it up. An "active scheduler" in the thread identifies the object that made the request, and passes control back to that object.

The implementation of active objects in Symbian
Symbian
Symbian is a mobile operating system and computing platform designed for smartphones and currently maintained by Accenture. The Symbian platform is the successor to Symbian OS and Nokia Series 60; unlike Symbian OS, which needed an additional user interface system, Symbian includes a user...

 is based around each thread having a "request semaphore
Semaphore (programming)
In computer science, a semaphore is a variable or abstract data type that provides a simple but useful abstraction for controlling access by multiple processes to a common resource in a parallel programming environment....

". This is incremented when a thread makes an asynchronous request, and decremented when the request is completed. When there are no outstanding requests, the thread is put to sleep.

In practice there may be many active objects in a thread, each doing its own task. They can interact by requesting things of each other, and of active objects in other threads. They may even request things of themselves.

This is an implementation of a very old idea that was developed to handle software interruptions in the 70s. The operating system was acting as the first object and the peripheral as the second one.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK