This page was last modified 09:14, 9 December 2007.
Active Scheduler
From Forum Nokia Wiki
In Symbian OS an Active Scheduler is responsible for scheduling active objects. As described here, active objects provide support for asynchronous processing. Using multiple threads for this purpose is discouraged (though not forbidden) in Symbian OS due to its resource-intensive nature in a resource-constrained environment.
It is worth noting that the Active Scheduler schedules active objects in a non-pre-emptive way so that one active object cannot interrupt another while that is running. This is in contrast with thread scheduling (even in Symbian OS), since the execution of one thread can be pre-empted at any given time by another thread.
It is possible to customize the Active Scheduler in order to better suit a program's needs. For example, CBaActiveScheduler directly derives from CActiveScheduler in order to add some new features in addition to fine-tuning some existing ones.
Typically, a Symbian OS thread has a single Active Scheduler. As mentioned above, that Active Scheduler is responsible for managing all active objects belonging to the thread. However, sometimes it's desirable to use more than one Active Scheduler - and it can be done by nesting Active Schedulers. Nesting in this context means that a new Active Scheduler instance takes over the role of the current one (which in turn might be another nested Active Scheduler, too) including the management of all active objects.
Why is it good to nest Active Schedulers? Due to the blocking nature of nesting. Sometimes we'd like the execution flow to stop for a while and wait until an external event occurs (example: show a dialog and wait for a keypress). We could use, e.g., User::WaitForRequest() for this purpose, but that blocks the entire thread. We'd like that this blocking happen so that the (rest of the) active objects remain active and responsive. And nesting Active Schedulers is the right tool for that: it blocks the current execution flow (and the outer Active Scheduler), whilst lets the active objects be responsive (managed by the inner Active Scheduler).
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Event loop in console application.... | VinodRaut | General Symbian C++ | 4 | 2007-10-22 17:23 |
| service discovery and active scheduler panic | spiralsun | Bluetooth Technology | 0 | 2002-12-14 16:39 |
| Active Object and Multitasking? | hmchau | General Symbian C++ | 11 | 2007-12-13 01:18 |
| WebClient and class problem | mariosas | General Symbian C++ | 5 | 2006-12-13 09:50 |
| CContactDatabase | jimdeal | General Symbian C++ | 3 | 2003-08-29 14:12 |
