Menu

#430 complete dynamtic deadlock detection (DDD)  Edit

runtime (all)
open
nobody
None
2026-01-09
2024-07-26
No

last status from ticket#390

  • copyright notice added added to static and dynamic deadlock detection files
  • rename in runtime from hfujk to DynamicDeadlockDetection
  • logging of deadlock operations disabled by default
  • deadlock detection (static and dynamic) is disabled if REF TASK/PROC/SEMA or BOLT is detected

found items to optimize

  • dynamic deadlock detection stores the names of resources and tasks as string in DeadlockOperation.h. This should be replaced by pointers to TaskCommon and Sema/Bolt
  • resource allocation log
    • uses stringstream
    • ResourceAllocationGraph::isDeadlocked() to cout should print to platform dependend channel or Log
    • enable/disable of logging lock operations should be possible by option (e.g. Log::DEADLOCK)
  • dynamic deadlock detection seams to be incomplete with deadlock operation via REF SEMA/BOLT, since the deadlock operations are hard coded with task and resource name --> testsuite/build/851_ref_deref.prl fails

Discussion

  • Rainer Müller

    Rainer Müller - 2025-10-03

    current status

    since the dynamic deadlock detection provides no advantage versus the static deadlock detection another approach is needed.

    alternative idea

    Definitions:
    * DRO (deadlock relevant operations) are semaphore and bolt operations except TRY and ACTIVATE
    * DRP (deadlock relevant procedures) contain at least one DRO
    * DRT (deadlock relevant tasks) contain at least one DRO

    Actions in the compiler:
    1. the compiler marks all defined procedures and tasks containing semaphore or bolt operations as deadlock relevant
    2. each deadlock relevant procedure is checked if there are REF PROC elements with the same signature. Each PROC which access such a REF PROC becomes also deadlock relevant
    3. the above step is repeated with the new REF PROC signatures
    4. each task which access a REF PROC with a signature of a DRP
    5. the compiler exports DRP and DRT for the IMC as well as with REF PROC and REF TASK are used

    Actions in the IMC:
    1. check if specified tasks and procedures are DRP or DRT and mark the using objects a deadlock relevant
    2. export all DRT to the runtime system

    Actions in the runtime system:
    1. if a DRO blocks the calling task it must be checked if there is at least 1 DRT not blocked with a deadlock resource
    2. if there is no DRT was found, the deadlock situation may be dumped to the log file
    3. if there was least one DRT found, the system continues

    Benefits:
    * REF and array of semaphores and bolt can be treated
    * procedures the semaphores as formal parameters may be treated
    * REF on PROC and TASK may be used

    Problems:
    * a DRT would mark each procedure using a REF TASK an DRP
    * a DRP with with a simple signature (eg. no parameter, no returns) would mark many objects using a REF with such a signature as deadlock relevant
    * maybe the IMC might warn if dummy parameter may reduce this flooding

     
  • Rainer Müller

    Rainer Müller - 2026-01-09

    2026-01-09: Decision

    The dynamic deadlock detection becomes removed from the code base.
    A tag beforeDynamicDeadlockDetectionRemoval will be set

     

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB