Skip to content

BWOS && static_thread_pool bug #2130

Description

@moonbreezelate

Problem:

1. There's still a bug in bwos: 
    when the owner is pushing, multiple thieves can steal at the same time, which may lead to them stealing the same task.
2. static_thread_pool has a lock-order-inversion issue when notifying.```

Testing method:

1. A standalone thread pool project (keeping only static_thread_pool, bwos, and related code)
3. -fsanitize=thread

my temporary solution:

1. Use shared_mutex to protect thieves from stealing tasks while pushing
2. Atomic wait

When the thread pool is purer and the tasks are smaller, it means that the collisions between particles are more intense, thereby allowing more problems to be discovered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions