Symbian3/PDK/Source/GUID-314FAEB5-946C-4090-B6AA-1BEEC9BE8EFB.dita
changeset 12 80ef3a206772
parent 9 59758314f811
equal deleted inserted replaced
11:5072524fcc79 12:80ef3a206772
   309 to run". (Typically <xref href="GUID-619AF4A9-4DAF-3FA4-A704-717DB30B5389.dita"><apiname>CAsyncOneShot</apiname></xref> is used for the active
   309 to run". (Typically <xref href="GUID-619AF4A9-4DAF-3FA4-A704-717DB30B5389.dita"><apiname>CAsyncOneShot</apiname></xref> is used for the active
   310 object.)</p></li>
   310 object.)</p></li>
   311 <li id="O"><p>The active scheduler is nested.</p></li>
   311 <li id="O"><p>The active scheduler is nested.</p></li>
   312 <li id="P"><p>One or more high priority active objects are started (probably
   312 <li id="P"><p>One or more high priority active objects are started (probably
   313 several times), which all make requests on a server. </p></li>
   313 several times), which all make requests on a server. </p></li>
   314 <li id="Q-GENID-1-11-1-1-5-1-6-1-3-5-19-4"><p>The high priority active object(s) are serviced and immediately
   314 <li id="Q-GENID-1-11-1-1-7-1-6-1-3-5-19-4"><p>The high priority active object(s) are serviced and immediately
   315 restarted. This continues until there is no more work for the high priority
   315 restarted. This continues until there is no more work for the high priority
   316 active object(s) to do.</p></li>
   316 active object(s) to do.</p></li>
   317 <li id="Q-GENID-1-11-1-1-5-1-6-1-3-5-19-5"><p>The low priority active object runs and un-nests the active
   317 <li id="Q-GENID-1-11-1-1-7-1-6-1-3-5-19-5"><p>The low priority active object runs and un-nests the active
   318 scheduler.</p></li>
   318 scheduler.</p></li>
   319 </ol><p>In a single core environment, the server always processes the client
   319 </ol><p>In a single core environment, the server always processes the client
   320 requests before the client can run any other code (because the server runs
   320 requests before the client can run any other code (because the server runs
   321 in a higher priority thread). When the client thread runs, the high priority
   321 in a higher priority thread). When the client thread runs, the high priority
   322 active objects are already "ready to run" and get serviced before the low
   322 active objects are already "ready to run" and get serviced before the low
   440 would have been destroyed. </p><p>A similar issue exists where, instead of
   440 would have been destroyed. </p><p>A similar issue exists where, instead of
   441 recreating the thread with the same name, a kernel heap check is performed
   441 recreating the thread with the same name, a kernel heap check is performed
   442 to ensure all kernel memory has been cleaned up. </p><p>There are three possibilities
   442 to ensure all kernel memory has been cleaned up. </p><p>There are three possibilities
   443 to fix this problem: </p><ol>
   443 to fix this problem: </p><ol>
   444 <li id="X"><p>Recreate the thread with a different name.</p></li>
   444 <li id="X"><p>Recreate the thread with a different name.</p></li>
   445 <li id="Y-GENID-1-11-1-1-5-1-6-1-3-6-12-2"><p>Wait a "little bit" before recreating the thread (or performing
   445 <li id="Y-GENID-1-11-1-1-7-1-6-1-3-6-12-2"><p>Wait a "little bit" before recreating the thread (or performing
   446 the heap check). </p><p>This is almost always a bad idea as there is no way
   446 the heap check). </p><p>This is almost always a bad idea as there is no way
   447 of knowing how long to wait and this may be different on any future system.</p></li>
   447 of knowing how long to wait and this may be different on any future system.</p></li>
   448 <li id="Y-GENID-1-11-1-1-5-1-6-1-3-6-12-3"><p>Wait for the object concerned to be completely destroyed.</p></li>
   448 <li id="Y-GENID-1-11-1-1-7-1-6-1-3-6-12-3"><p>Wait for the object concerned to be completely destroyed.</p></li>
   449 </ol><p>In general, option 1 is preferred. For code that is likely to encounter
   449 </ol><p>In general, option 1 is preferred. For code that is likely to encounter
   450 the problem in practice, APIs should be provided to aid with creating objects
   450 the problem in practice, APIs should be provided to aid with creating objects
   451 with a unique name. For example, the <codeph>TDynamicDfcQue</codeph> and <codeph>Kern::DynamicDfcQCreate</codeph> APIs
   451 with a unique name. For example, the <codeph>TDynamicDfcQue</codeph> and <codeph>Kern::DynamicDfcQCreate</codeph> APIs
   452 are provided to help with creating DFC threads with unique names. </p><p>Using
   452 are provided to help with creating DFC threads with unique names. </p><p>Using
   453 a different name is easy in the above code example but it's not possible when
   453 a different name is easy in the above code example but it's not possible when