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