Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • Tor Tor
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 831
    • Issues 831
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 31
    • Merge requests 31
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • The Tor Project
  • Core
  • TorTor
  • Issues
  • #9682

Closed
Open
Created Sep 05, 2013 by Nick Mathewson@nickm👉Owner

Better work queue implementation for cpuworkers

Our current implementation for passing work to cpuworkers and getting answers from them is pretty bulletproof: we share an fd with each one, write our requests there as a serialized struct, and get our answers back as serialized struct. The cpuworker learns about new requests by calling read(); we learn about new answers from libevent().

But probably this isn't as efficient as it could be:

  • We should have a work queue implementation that doesn't require a cpuworker to wait for the main process to give it more data after each request it answers.
  • We should have a work queue implementation that uses condition variables as appropriate to notify cpuworkers of new data.
  • We should use appropriate libevent mechanisms notify the main thread of new answers. (There are a bunch of ways to implement a condition variable that wakes libevent; we should pick one.)
  • We should manage the communication in-memory rather than over sockets.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking