Symbian3/PDK/Source/GUID-2C5D53A3-0211-5C14-BD7F-E89EB27BAD2A.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Tue, 30 Mar 2010 11:56:28 +0100
changeset 5 f345bda72bc4
parent 3 46218c8b8afa
child 14 578be2adaf3e
permissions -rw-r--r--
Week 12 contribution of PDK documentation_content. See release notes for details. Fixes Bug 2054, Bug 1583, Bug 381, Bug 390, Bug 463, Bug 1897, Bug 344, Bug 1319, Bug 394, Bug 1520, Bug 1522, Bug 1892"

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-2C5D53A3-0211-5C14-BD7F-E89EB27BAD2A" xml:lang="en"><title>Active
Scheduler</title><shortdesc>This document describes how active objects are queued using active
schedulers.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>Where multiple asynchronous services are used by a program, a <i>wait loop</i> is
required. </p>
<p>The <codeph>CActiveScheduler</codeph> class encapsulates the wait loop. </p>
<p>Nearly all threads use an active scheduler. Low-level test programs may
have to construct their own active scheduler, but all server threads and all
UI programs, have an active scheduler after they have initialized. If an active
scheduler is present, active objects may be added to it and removed from it
at will. </p>
<p>A thread may not have more than one active scheduler. </p>
<p>Active scheduler provides a non pre-emptive multi-tasking system, using
which active objects run on a single thread. </p>
<p>In Symbian platform, it is easier to write a system of co-operating active
objects than a system of co-operating threads. The run-time cost of an active
object is also significantly less than that of a thread. Creating and destroying
active objects is <i>very</i> much more efficient than creating and destroying
threads. </p>
<p>When the active scheduler executes its wait loop, the order in which active
objects are tested for scheduling is determined by their relative priorities.
Most active objects should have a priority of zero and there should be an
assumption that their relative position in the queue is irrelevant. No processing
should ever depend on the order in which active objects are scheduled. </p>
<section id="GUID-44BB8E7C-F310-42F5-B303-0D824AE86BA2"><title>See also</title> <p> <xref href="GUID-890F06C6-DE32-5EB1-BF0F-D41794F47AE1.dita">Active
objects</xref>  </p> <p> <xref href="GUID-9C36CF76-6ED2-5674-908F-A3DF8930CEB0.dita">How
to renew a request from the active scheduler</xref>. </p> </section>
</conbody></concept>