Symbian3/PDK/Source/GUID-38BE7105-309E-5372-98EE-BCA0ADD0ACBA.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 02 Jul 2010 12:51:36 +0100
changeset 11 5072524fcc79
parent 5 f345bda72bc4
child 14 578be2adaf3e
permissions -rw-r--r--
Fixing terminology

<?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-38BE7105-309E-5372-98EE-BCA0ADD0ACBA" xml:lang="en"><title>Hybrid
Applications</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>P.I.P.S. applications can be written either as pure C or as hybrid applications
which mix native Symbian C++ and Standard C. In addition to the core P.I.P.S.
libraries, an application can also use P.I.P.S. extensions or third-party
C shared libraries. Hybrid applications can also link against native Symbian
platform libraries. </p>
<p>The use cases for hybrid applications are as follows: </p>
<ul>
<li id="GUID-2FDE4170-7A71-5047-BC65-5089DB717746"><p>Native Symbian <codeph>EXE</codeph> using
both Standard C and native Symbian platform C++ APIs </p> </li>
<li id="GUID-8D102C96-50B5-51B1-884B-76F9646D7BBF"><p> <codeph>STDEXE</codeph> using
both Standard C and native Symbian platform C++ APIs </p> </li>
<li id="GUID-240056C6-0296-5C1C-BCB1-281E28F30841"><p>Native Symbian <codeph>EXE</codeph> depending
on an <codeph>STDDLL</codeph> which uses Standard C APIs </p> </li>
<li id="GUID-8CB831F1-FDB3-5B60-9652-3C2552B1D07C"><p> <codeph>STDEXE</codeph> using
a native Symbian <codeph>DLL</codeph> which uses native Symbian platform C++
APIs </p> </li>
<li id="GUID-CDA31C5D-0FB0-532D-801F-0E365DD92E6D"><p> <codeph>STDDLL</codeph> using
both Standard C and native Symbian platform C++ APIs </p> </li>
<li id="GUID-5BB61F60-82AE-580C-82CB-AAADF30B3E75"><p>Native Symbian <codeph>DLL</codeph> using
both Standard C and native Symbian platform C++ APIs </p> </li>
</ul>
<section id="GUID-CC6F2464-A914-4358-8AA6-929E2E41CDAC"><title>Threads and
hybrid applications</title> <p>The <codeph>pthread</codeph> and <xref href="GUID-B0E661BC-4058-3256-B9C3-5A4FD52F6DE5.dita"><apiname>RThread</apiname></xref> APIs
do not mix. Symbian platform heaps are managed thread-wise whereas P.I.P.S.
heaps are managed process-wise. Mixing <codeph>pthread</codeph> and <codeph>RThread</codeph> <i>may</i> result
in panics due to data being lost or orphaned. So, do not mix the two unless
you know what you're doing. </p> <p>User libraries or executables
written using P.I.P.S. must not allocate resources in the context of the calling
thread as the thread might be using a private heap which is inaccessible to
other threads and might have a different lifetime. </p> <p>To minimise the
risks avoid using <codeph>RThread</codeph> APIs in primarily POSIX applications
or libraries (those entering via <codeph>main()</codeph>), and avoid using <codeph>pthread</codeph> in
primarily Symbian platform applications or libraries (those entering via <codeph>E32Main()</codeph>). </p> </section>
</conbody></concept>