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