Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Communicate buffer creation to graph generator through scheduler event #138

Merged
merged 4 commits into from
Aug 31, 2022

Conversation

fknorr
Copy link
Contributor

@fknorr fknorr commented Aug 25, 2022

Currently the graph generator holds a m_buffer_mutex for the sole purpose of synchronizing buffer addition between main thread and scheduler thread. This is contrary to the otherwise thread-unaware design of the graph generator and could cause scheduler stalls if buffers are constructed while tasks are scheduled.

This PR introduces a new scheduler event for buffer addition which makes this mutex unnecessary. It also transfers ownership of graph generator and graph serializer to the scheduler in order to prevent accidental concurrent access from a non-scheduler thread.

test_utils::mock_buffer_factory also gets a richer constructor interface to be able to deal with either a non-threaded graph generator or a threaded scheduler.

@fknorr fknorr self-assigned this Aug 25, 2022
@github-actions
Copy link

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Member

@psalz psalz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat, LGTM!

Copy link

@BlackMark29A BlackMark29A left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, I just have one minor remark:

include/scheduler.h Outdated Show resolved Hide resolved
@github-actions
Copy link

clang-tidy review says "All clean, LGTM! 👍"

@fknorr fknorr merged commit 56156ed into master Aug 31, 2022
@fknorr fknorr deleted the buffer-create-scheduler-event branch August 31, 2022 13:06
@fknorr fknorr restored the buffer-create-scheduler-event branch August 31, 2022 13:50
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.

3 participants