Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • S snf-ganeti
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Artifacts
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Model experiments
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • itmineduitminedu
  • snf-ganeti
  • Repository
  • snf-ganeti
  • lib
  • workerpool.py
Find file Blame History Permalink
  • Michael Hanselmann's avatar
    workerpool: Change data structure for priority change · 125b74b2
    Michael Hanselmann authored Oct 30, 2012
    To prepare for the addition of a new function allowing changing a
    pending task's priority, the internal data structure is slightly
    changed. The (optional) task ID is stored as part of the task entry. A
    new dictionary provides a mapping from the task ID to its task entry. If
    the task ID is None, the entry is not added to the map.
    
    Task entries used to be a tuple, but since modifying the priority
    requires changing an entry, they are changed to lists in this patch.
    Tuple items can not be modified.
    
    The underlying idea is from [1].
    
    [1]:
    http://docs.python.org/library/heapq.html#priority-queue-implementation-notes
    
    
    
    Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
    Reviewed-by: default avatarBernardo Dal Seno <bdalseno@google.com>
    125b74b2