-
Notifications
You must be signed in to change notification settings - Fork 87
Add more operation analysis, combine with deletes and inserts variables. #9
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
Conversation
83ad215
to
60c690d
Compare
Because the |
However, macro |
I only change ATOMIC_FETCH ADD into TRACE_ATOMIC_FETCH_ADD for distinguishing record operation from normal. There are other solutions, but I think this is the best one because it does not cost more memory or if-else statement. |
b91d931
to
5879546
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use wrapper macro for runtime stat initialization/hook.
319d216
to
ecc3610
Compare
hp_list/main.c
Outdated
do { \ | ||
atomic_store_explicit(obj, desired, order); \ | ||
} while (0) | ||
#define TRACE(ops) ({}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rewrite macro TRACE
as following:
do { /* nothing involved */ } while (0)
The names are from A more Pragmatic Implementation of the Lock-free, Ordered, Linked List. |
Cite the publication within comments as well. |
And Using the preprocessor to decide the analysis being set or not. The following are the new varialbes to record the opreations: rtry is the number of retries in the __list_find function. cons is the number of wait-free contains in the __list_find function that curr pointer pointed. trav is the number of list element traversal in the __list_find function. fail is the number of CAS() failures. del is the number of list_delete operation failed and restart again. ins is the number of list_insert operation failed and restart again. load is the number of atomic_load operation in list_delete, list_insert and __list_find. store is the number of atomic_store operation in list_delete, list_insert and __list_find.
Thank @linD026 for the great work! |
Add more operation analysis, combine with deletes and inserts variables.
And Using the preprocessor to decide the analysis being set or not.
For example:
The following are the new variables to record the operations:
rtry is the number of retries in the __list_find function.
cons is the number of wait-free contains in the __list_find function that curr pointer pointed.
trav is the number of list element traversal in the __list_find function.
fail is the number of CAS() failures.
del is the number of list_delete operation failed and restart again.
ins is the number of list_insert operation failed and restart again.