Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-85877

Use restartable sequences to implement a 64-bit counter

    • Type: Icon: Task Task
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal Code
    • None
    • Service Arch

      The counter (i.e. Counter) will point to a contiguous region of memory containing all of its partitions. It will use rseq to implement increment operations:

      • The start (restart) code will use the following to index the array of counters and compute the address for the partition that needs to be updated:
        • The identifier of the logical core running the update. This is used to index a lookup table that comes before the counter storage. The following figure is an illustration of the memory layout for an object with 7 counters (yellow boxes) running on a 4 core system.
        • The (zero-based) offset assigned to the counter.
      • The commit code will perform the requested update (increment or decrement) on the address computed in the previous stage.

      It also provides a read API that returns the aggregate of all partitions for the counter. This will be the building block to implement CounterHolder.

            Assignee:
            backlog-server-servicearch [DO NOT USE] Backlog - Service Architecture
            Reporter:
            amirsaman.memaripour@mongodb.com Amirsaman Memaripour
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: