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

Use a queue to keep track of running and blocked tasks in rust_sched_loop #2100

Closed
wants to merge 7 commits into from

Conversation

jamorton
Copy link
Contributor

@jamorton jamorton commented Apr 2, 2012

I originally had the linked list logic in sched_loop but it was messy, so I moved it out to a separate data structure class. Not sure how worth it this will be when blocked_tasks gets removed altogether, but here it is.

Fixes #2028

jamorton added 5 commits April 1, 2012 19:02
…loop.

Create a new data structure called rust_task_queue that holds a circular doubly linked list of tasks. This is used in rust_sched_loop to keep track of running and blocked tasks, moving tasks between the two lists should be more efficient.
@jamorton
Copy link
Contributor Author

jamorton commented Apr 2, 2012

also, if this lands then it looks like rt/util/index_list.h and rt/util/synchronized_indexed_list.h can be removed entirely.

@jamorton jamorton closed this Apr 2, 2012
@jamorton jamorton reopened this Apr 2, 2012
@brson
Copy link
Contributor

brson commented Apr 2, 2012

After thinking about this more at lunch I'm still not convinced that either way is better. One we add automatic preemption points and time slice accounting the way that tasks are scheduled will need to change again.

I do like the idea of getting rid of indexed_list and synchronized_indexed_list. I'm not even sure what synchronized_indexed_list is used for and why.

@jamorton
Copy link
Contributor Author

jamorton commented Apr 2, 2012

synchronized_indexed_list isn't used anywhere and could probably be removed regardless.

@brson
Copy link
Contributor

brson commented Apr 4, 2012

This approach turned out to be wrong. We are not going to merge it. Please accept my apologies.

@brson brson closed this Apr 4, 2012
@jamorton
Copy link
Contributor Author

jamorton commented Apr 4, 2012

no problem!

celinval pushed a commit to celinval/rust-dev that referenced this pull request Jun 4, 2024
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.

Convert rust_task_thread::running_tasks list to a queue
2 participants