Skip to content

Conversation

@mzient
Copy link
Contributor

@mzient mzient commented Jul 11, 2025

Category:

Other (e.g. Documentation, Tests, Configuration)

Description:

Separate queue lock

Previously the scheduler featured just one mutex to guard everything. This PR adds a separate lock for the queue of ready tasks. This reduces contention when popping tasks by worker threads.

Use semaphore for queue state tracking

Prior to this change, a condition variable was used to wake up worker threads when ready tasks became available. This PR uses a semaphore which is raised when a task becomes ready and lowered before one is popped.

Additional information:

Affected modules and functionalities:

Key points relevant for the review:

dali/core/exec/tasking_test.cc

  • Existing tests apply
  • New tests added
    • Python tests
    • GTests
    • Benchmark
    • Other
  • N/A

Checklist

Documentation

  • Existing documentation applies
  • Documentation updated
    • Docstring
    • Doxygen
    • RST
    • Jupyter
    • Other
  • N/A

DALI team only

Requirements

  • Implements new requirements
  • Affects existing requirements
  • N/A

REQ IDs: N/A

JIRA TASK: N/A

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [31490037]: BUILD STARTED

@mzient mzient changed the title Tasking semaphore Use semaphore and spinlock in tasking::Scheduler Jul 11, 2025
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [31490386]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [31490037]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [31495691]: BUILD STARTED

mzient added 2 commits July 11, 2025 12:49
Signed-off-by: Michał Zientkiewicz <[email protected]>
Signed-off-by: Michał Zientkiewicz <[email protected]>
@mzient mzient force-pushed the tasking_semaphore branch from 995f760 to bf8e73b Compare July 11, 2025 10:49
Signed-off-by: Michał Zientkiewicz <[email protected]>
@dali-automaton
Copy link
Collaborator

CI MESSAGE: [31496995]: BUILD STARTED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [31495691]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [31496995]: BUILD FAILED

@dali-automaton
Copy link
Collaborator

CI MESSAGE: [31496995]: BUILD PASSED

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants