Symbian3/SDK/Source/GUID-AAA2ABA4-5555-5E4B-AEFF-3DF61462B170.dita
author Dominic Pinkman <Dominic.Pinkman@Nokia.com>
Wed, 31 Mar 2010 11:11:55 +0100
changeset 7 51a74ef9ed63
parent 0 89d6a7a84779
permissions -rw-r--r--
Week 12 contribution of API Specs and fix SDK submission

<?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-AAA2ABA4-5555-5E4B-AEFF-3DF61462B170" xml:lang="en"><title>Introduction
to asynchronous programming</title><shortdesc>This document introduces the concept of asynchronous programming.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>When a program requests a service, this service can be performed either <i>synchronously</i> or <i>asynchronously</i>. </p>
<p>A synchronous service is the normal pattern for function calls where the
function returns and the service requested has either performed successfully
or has failed and an error code returned.</p>
<p>An asynchronous service is <i>requested</i> by a function call but completion
occurs later. Completion is indicated by a <i>signal</i>. Between the issue
of the request and the signal, the request is said to be <i>pending</i>. The
requesting program can do other processing while the request is pending or
it can issue a <i>wait</i>. The operating system wakes the program up when
completion of any of its pending requests is signalled.</p>
<p>A program may contain a number of independently-executing units, called
threads. All programs have a primary thread, and may create other threads,
possibly for providing or using asynchronous services.</p>
<p>If all threads are in a wait state, for example, waiting for user input,
Symbian platform powers down as much as possible of the machine’s electronics.
This results in battery savings and, consequently, a considerable extension
of useful battery life.</p>
</conbody></concept>