Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Arti Arti
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 147
    • Issues 147
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Core
  • ArtiArti
  • Issues
  • #205
Closed
Open
Created Oct 27, 2021 by eta@eta💚Maintainer

Consider leaning into the reactor pattern more, instead of using mutexes

Using Mutexes too much can be a bit of an antipattern: it introduces the possibility of deadlocks, it can interact poorly with await boundaries (see #181 (closed) too), and it can make the code a bit harder to reason about, especially when multiple locks are involved.

Some code that uses mutexes (like ClientCirc in tor-proto) uses it to share state with a separate "reactor" task. It might make more sense to make more use of that reactor (by extending the existing message-passing code), instead of having to use a mutex to share state in this way.

(There's probably more than just that example, as well!)

Assignee
Assign to
Time tracking