home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / DC-POS24.LZX / pOS / pOS_RKRM.lzx / pOS_RKRM / _Txt / DebugDeadLock.txt < prev    next >
Encoding:
Text File  |  1997-03-18  |  1.2 KB  |  41 lines

  1. Debugging von Deadlock-Situationen unter pOS:
  2. ---------------------------------------------
  3.  
  4. /* aus pExec/Types.h */
  5. enum pOS_DebugSysSemaphorePri
  6. {
  7.   pOSd_SYSSEM_FirstApp    = 109,  // erste Pri für Applikationen
  8.   pOSd_SYSSEM_LastApp    = 61,   // letzte Pri für Applikationen
  9.  
  10.   pOSd_SYSSEM_Unit    = 50,   // iu_Sem
  11.   pOSd_SYSSEM_Gad    = 40,   // iu_GadSem
  12.   pOSd_SYSSEM_LInfo    = 30,   // pOS_LayerInfo
  13.   pOSd_SYSSEM_Layer    = 20,   // pOS_Layer
  14. };
  15.  
  16.  
  17.  
  18. In (enum pOS_DebugSysSemaphorePri) sind die verwendeten bzw.
  19. verwendbaren Kennungen (ln_Pri) definiert. Nur in Debug-pOS
  20. wird der Debug-Mechanismus eingesetzt. Bei jedem Zugriff
  21. auf eine Semaphore wird geprüft, ob die neue Sem. eine
  22. gleiche oder geringere ln_Pri besitzt. Wird eine höhere
  23. ln_Pri entdeckt, so deutet dies auf eine Deadlock-Gefahr
  24. hin. Das pOS ist nur mit geschachtelten Semaphore-Obtains
  25. einverstanden, die zu einer kleinere ln_Pri streben.
  26. Z.B.
  27.  
  28. ObtainSemaphore( pIntui );  =>  pOSd_SYSSEM_Unit
  29.  ObtainSemaphore( Gad );    =>  pOSd_SYSSEM_Gad
  30.   ObtainSemaphore( Layer ); =>  pOSd_SYSSEM_Layer
  31.  
  32.    ObtainSemaphore( LayerInfo ); =>  pOSd_SYSSEM_LInfo => ERROR
  33.  
  34.  
  35. Damit nicht alle Semaphoren getestet werden, prüft pOS zuerst die ln_Pri
  36. auf >0. Alle ln_Pri von null werden ohne Debug bearbeitet.
  37.  
  38.  
  39.  
  40. ©proDAD
  41.