Skip to content

PTP Managed Zone

ZjzMisaka edited this page Mar 19, 2026 · 1 revision
@startuml

skinparam BackgroundColor #F5F7FA
skinparam defaultTextAlignment center
skinparam ArrowThickness 1.5
skinparam componentStyle rectangle
skinparam NoteBackgroundColor #FFFDE7
skinparam NoteBorderColor #9E9E9E
skinparam linetype ortho

' ─── PTP-Managed Zone ──────────────────────────────────
rectangle "PTP-Managed Zone" as MZ #EBF5FB {

  rectangle "PTP Layer" as PTPL #BBDEFB {
    [PowerThreadPool] as PTP
    [Custom SyncContext] as SC
    [Worker Threads] as WT
    PTP -[#1565C0]-> SC : installs
    SC -[#1565C0]-> WT : dispatch
  }
  note as N_FEAT #DDEEFF
    Pause / Resume
    Cancel / Stop
    Priority / Timeout
    ...
  end note
  PTP .. N_FEAT

  rectangle "User Layer" as UL #C8E6C9 {
    [User Async Task] as UAT
    [cont.] as C1
    [cont.] as C2
    UAT -[#2E7D32]-> C1 : await
    C1 -[#2E7D32]-> C2 : await
  }

  PTP -[#1565C0]-> UAT : schedule & control
  SC -[#43A047,dashed]-> C1 : capture
  SC -[#43A047,dashed]-> C2 : capture
}

' ─── 3rd-party Layer ───────────────────────────────────
rectangle "3rd-party Layer\nAssuming ConfigureAwait(false)" as TPL #FFF8E1 {
  [3rd-party Library] as LIB
  [internal cont.] as IC
  LIB -[#E65100]> IC : await
  note bottom of IC #FFECB3
    PTP: Does not manage its continuations
    3rd: Does not rely on PTP-specific features.
  end note
}

UAT -[#78909C]-> LIB : call

@enduml

Clone this wiki locally