Skip to content

Executor::spin_some() should check for work only once #471

Description

@wjwwood

I believe spin_some behaves contrary to how most people would assume. I believe most people assume that if there are three things to do when you call spin_some() only three things will be done then it would return. Even if new work items come up during that execution.

However, right now spin_some() will check if there is work to do after each work item is completed. This means that if you have more work coming in than you can execute, spin_some() will never exit because there is always something to do.

This could be fixed by "claiming" everything there is to do when spin_some() starts, then executing each of them and then exit. Basically only checking for work one time, at the beginning of the method.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions