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

Refactor DispatchQueue to use an intrusive list instead of an std::list #511

Merged
merged 4 commits into from
May 19, 2015

Conversation

codemercenary
Copy link
Contributor

An intrusive linked list, in this case, is a much better choice. Heap allocations for each entry in the collection are unavoidably necessary because entries have a variable size, which means a linked list is an improvement over std::list.

If necessary, a next step could be to use a journal-based arena allocator in order to keep links in the list sequential with respect to each other.

@codemercenary codemercenary force-pushed the ref-intrusivelinkage branch from 7da6e65 to 47c597f Compare May 17, 2015 16:12
An intrusive linked list, in this case, is a much better choice.  Heap allocations for each entry in the collection are unavoidably necessary because entries have a variable size, which means a linked list is an improvement over `std::list`.

If necessary, a next step could be to use a journal-based arena allocator in order to keep links in the list sequential with respect to each other.
@codemercenary codemercenary force-pushed the ref-intrusivelinkage branch from 47c597f to 34be59a Compare May 17, 2015 16:17
// Now abandon the queue, this should cause the async thread to quit:
ct->Abort();
ASSERT_EQ(std::future_status::ready, f.wait_for(std::chrono::seconds(5))) << "Barrier did not abort fast enough";
ASSERT_TRUE(*exception) << "Exception should have been thrown inside the Barrier call";
ASSERT_FALSE(f.get()) << "Exception should have been thrown inside the Barrier call";
Copy link
Contributor

Choose a reason for hiding this comment

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

This assert fails on mac

@codemercenary codemercenary force-pushed the ref-intrusivelinkage branch from c58dcc4 to 21a19e1 Compare May 19, 2015 03:20
@codemercenary codemercenary force-pushed the ref-intrusivelinkage branch from 21a19e1 to cabbd11 Compare May 19, 2015 03:26
@codemercenary codemercenary force-pushed the ref-intrusivelinkage branch from c2724d7 to d4a6852 Compare May 19, 2015 11:33
@codemercenary
Copy link
Contributor Author

Added a test to make the failure @gtremper identified occur more reliably, then added another test and corrected said behavior.

gtremper added a commit that referenced this pull request May 19, 2015
Refactor DispatchQueue to use an intrusive list instead of an std::list
@gtremper gtremper merged commit 3ae1763 into develop May 19, 2015
@gtremper gtremper deleted the ref-intrusivelinkage branch May 19, 2015 18:14
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