Symbian3/SDK/Source/GUID-8EAB97D5-267A-58CC-BC3E-5CB1D72CB7ED.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 11 Jun 2010 15:24:34 +0100
changeset 9 59758314f811
parent 0 89d6a7a84779
permissions -rw-r--r--
Week 23 contribution of PDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.

<?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-8EAB97D5-267A-58CC-BC3E-5CB1D72CB7ED" xml:lang="en"><title>Non
pre-emptive servicing</title><shortdesc>This document describes how requests to active objects are serviced
non pre-emptively.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>The UI server frameworks spend most of their time waiting for some event
to occur, and then spend a <i>short</i> time executing a <codeph>RunL()</codeph> function
to service that event. When one event has been serviced, processing returns
to the wait loop in the active scheduler allowing other events to be serviced.</p>
<p>If a second request completes while the <codeph>RunL()</codeph> function
is handling completion of the first request, then another call to <codeph>RunL()</codeph> to
handle completion of the second request cannot be scheduled until the first
invocation of <codeph>RunL()</codeph> is complete.</p>
<p>This means that active object scheduling is non pre-emptive.</p>
<p>Active objects are queued from the active scheduler in order of priority.
The priority is usually determined at the time that the active object is constructed,
although it can be changed later.</p>
<p>If several requests complete while a <codeph>RunL()</codeph> function is
handling the completion of earlier request, the active scheduler takes the
first active object (i.e. the one with the highest priority) with a completed
request and calls its <codeph>RunL()</codeph> function.</p>
<p>As scheduling is non pre-emptive, a high-priority request cannot be serviced
until the previously running request’s <codeph>RunL()</codeph> has completed.</p>
<section id="GUID-55AEDDD4-72FB-4865-90AF-D4F9C5B47582"><title>Recommendations for active object priority</title> <p>Most
active objects should have a priority of <codeph>TPriority::EPriorityStandard</codeph> and
processing should not depend on the order in which active objects are scheduled.</p> <p>However,
any active object involved in user input should have a higher priority over
other active objects to ensure responsiveness and to allow user control over
a device.</p> <p>Long running and background services should have a low priority.</p> </section>
</conbody></concept>