|
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-67718111-07FB-59CC-A9C2-86593F868C2C" xml:lang="en"><title>Features |
|
13 of the client-server architecture</title><shortdesc>Describes the features of the client-server architecture.</shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <section id="GUID-733332EE-A689-4D9A-AAE3-3980B915412B"><title>Context</title> <p>Each session maintains its own context. |
|
15 This allows sessions to be owned by different active objects within the same |
|
16 thread, by different components within the same thread, etc., without interference. </p> </section> |
|
17 <section id="GUID-35A7DB04-C9D5-47FF-A793-29533CD766A4"><title>Context switching</title> <p>Client-server communication requires |
|
18 context switching: </p> <ul> |
|
19 <li id="GUID-50EC1E74-44B3-52C7-A2E0-CA129561E25B"><p>messages are sent via |
|
20 the Kernel </p> </li> |
|
21 <li id="GUID-94E8A131-0E5C-5034-A903-E903A1121954"><p>handling the message |
|
22 involves a switch from client thread, to server thread, and back to client |
|
23 thread </p> </li> |
|
24 <li id="GUID-702DA432-6985-5046-92EB-C3159EAE7C2A"><p>inter-thread data transfer |
|
25 can never be done with simple C++ pointers: it always involves data copying. |
|
26 Furthermore, it may involve cross-address-space data transfer, if the threads |
|
27 are in different processes. </p> </li> |
|
28 </ul> <p>Compared with a simple function call or memory copy, context switching |
|
29 is a relatively expensive operation, and should be minimised. Servers whose |
|
30 performance is critical use buffering to minimise context switches. Sometimes, |
|
31 this is transparent. Often, the client interface design is affected by the |
|
32 requirement for buffering. </p> </section> |
|
33 <section id="GUID-BC1416C3-DD32-438E-A574-21802747220B"><title>Thread-based</title> <p>The basic architecture of servers |
|
34 is thread-based. This gives the implementers of a system the flexibility to |
|
35 package the server threads into whatever processes they choose, depending |
|
36 on the balance of requirements for security and economy. </p> <p>This can |
|
37 be contrasted with other systems in which all, or most, servers run as part |
|
38 of the Kernel. On Symbian platform this is not necessary, so security is better. </p> <p>Client-server |
|
39 policies can be contrasted with systems which require servers to have their |
|
40 own process. This uses more memory (e.g. for address translation tables), |
|
41 and has worse performance (inter-thread data transfer involves translation |
|
42 as well as copying). </p> </section> |
|
43 <section id="GUID-15B1DC2E-AB35-48DB-8EC4-11127DF974B0"><title>Cleanup</title> <p>When a client process terminates, all server |
|
44 resources associated with it should be cleaned up. </p> <p>When a session |
|
45 is ended, servers must clean up all objects associated with it, and clients |
|
46 must consider any handles associated with it as invalid, and perform any necessary |
|
47 client-side cleanup. </p> <p>For a non-sharable session, if the client thread |
|
48 dies, then the Kernel performs thread-death cleanup and sends a disconnect |
|
49 message to the server end of all sessions associated with that client thread. </p> <p>For |
|
50 a sharable session, the death of any or all client threads does not trigger |
|
51 closure of the session. This is because the session is process relative. To |
|
52 close a shared session, either the process must terminate, or the session |
|
53 must be explicitly closed through a client side call to <codeph>Close()</codeph> on |
|
54 the client-side session handle, <codeph>RSessionBase</codeph>. </p> </section> |
|
55 </conbody></concept> |