Symbian3/PDK/Source/GUID-38BE7105-309E-5372-98EE-BCA0ADD0ACBA.dita
changeset 5 f345bda72bc4
parent 3 46218c8b8afa
child 14 578be2adaf3e
equal deleted inserted replaced
4:4816d766a08a 5:f345bda72bc4
     7     Nokia Corporation - initial contribution.
     7     Nokia Corporation - initial contribution.
     8 Contributors: 
     8 Contributors: 
     9 -->
     9 -->
    10 <!DOCTYPE concept
    10 <!DOCTYPE concept
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    11   PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
    12 <concept xml:lang="en" id="GUID-38BE7105-309E-5372-98EE-BCA0ADD0ACBA"><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><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>
    12 <concept id="GUID-38BE7105-309E-5372-98EE-BCA0ADD0ACBA" xml:lang="en"><title>Hybrid
       
    13 Applications</title><prolog><metadata><keywords/></metadata></prolog><conbody>
       
    14 <p>P.I.P.S. applications can be written either as pure C or as hybrid applications
       
    15 which mix native Symbian C++ and Standard C. In addition to the core P.I.P.S.
       
    16 libraries, an application can also use P.I.P.S. extensions or third-party
       
    17 C shared libraries. Hybrid applications can also link against native Symbian
       
    18 platform libraries. </p>
       
    19 <p>The use cases for hybrid applications are as follows: </p>
       
    20 <ul>
       
    21 <li id="GUID-2FDE4170-7A71-5047-BC65-5089DB717746"><p>Native Symbian <codeph>EXE</codeph> using
       
    22 both Standard C and native Symbian platform C++ APIs </p> </li>
       
    23 <li id="GUID-8D102C96-50B5-51B1-884B-76F9646D7BBF"><p> <codeph>STDEXE</codeph> using
       
    24 both Standard C and native Symbian platform C++ APIs </p> </li>
       
    25 <li id="GUID-240056C6-0296-5C1C-BCB1-281E28F30841"><p>Native Symbian <codeph>EXE</codeph> depending
       
    26 on an <codeph>STDDLL</codeph> which uses Standard C APIs </p> </li>
       
    27 <li id="GUID-8CB831F1-FDB3-5B60-9652-3C2552B1D07C"><p> <codeph>STDEXE</codeph> using
       
    28 a native Symbian <codeph>DLL</codeph> which uses native Symbian platform C++
       
    29 APIs </p> </li>
       
    30 <li id="GUID-CDA31C5D-0FB0-532D-801F-0E365DD92E6D"><p> <codeph>STDDLL</codeph> using
       
    31 both Standard C and native Symbian platform C++ APIs </p> </li>
       
    32 <li id="GUID-5BB61F60-82AE-580C-82CB-AAADF30B3E75"><p>Native Symbian <codeph>DLL</codeph> using
       
    33 both Standard C and native Symbian platform C++ APIs </p> </li>
       
    34 </ul>
       
    35 <section id="GUID-CC6F2464-A914-4358-8AA6-929E2E41CDAC"><title>Threads and
       
    36 hybrid applications</title> <p>The <codeph>pthread</codeph> and <xref href="GUID-B0E661BC-4058-3256-B9C3-5A4FD52F6DE5.dita"><apiname>RThread</apiname></xref> APIs
       
    37 do not mix. Symbian platform heaps are managed thread-wise whereas P.I.P.S.
       
    38 heaps are managed process-wise. Mixing <codeph>pthread</codeph> and <codeph>RThread</codeph> <i>may</i> result
       
    39 in panics due to data being lost or orphaned. So, do not mix the two unless
       
    40 you know what you're doing. </p> <p>User libraries or executables
       
    41 written using P.I.P.S. must not allocate resources in the context of the calling
       
    42 thread as the thread might be using a private heap which is inaccessible to
       
    43 other threads and might have a different lifetime. </p> <p>To minimise the
       
    44 risks avoid using <codeph>RThread</codeph> APIs in primarily POSIX applications
       
    45 or libraries (those entering via <codeph>main()</codeph>), and avoid using <codeph>pthread</codeph> in
       
    46 primarily Symbian platform applications or libraries (those entering via <codeph>E32Main()</codeph>). </p> </section>
       
    47 </conbody></concept>