Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in
M
margo
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 12
    • Issues 12
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 1
    • Merge Requests 1
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • sds
  • margo
  • Issues
  • #18

Closed
Open
Opened Aug 22, 2016 by Jonathan Jenkins@jenkins
  • Report abuse
  • New issue
Report abuse New issue

mechanism to prevent startup races

Recently, the following pattern has caused me headaches:

  • id = margo_init(...)
  • initialize subsystems with id, including registering RPCs
  • process RPCs from others

The problem that comes up from this approach is a race between other folks calling the subsystem RPCs and that subsystem's initialization. Once margo_init is called, the process is open for business.

A few ways to prevent this:

  • call sleep(X) on the RPC callers :)
  • restructure code such that initialization of subsystems doesn't require a margo id. Not exactly ideal.
  • add the ability to defer kicking off the progress loop until we're ready for it to run (assuming that a dedicated progress thread is being used).

My preference is the third option, as it seems cleanest from a user perspective, though I'm open to suggestions.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
0
Labels
None
Assign labels
  • View project labels
Reference: sds/margo#18