Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#include <immintrin.h>
#include <stdio.h>
int main(int argc, char *argv[]) {
int len = 16;
char* arr = malloc(1024*1024*16);
int stride = 1024*4;
// warm TLB
for (int i = 0; i < len; i++) {
arr[i*stride] = 1;
}
if (_xbegin() == -1) {
for (int i = 0; i < len; i++) {
arr[i*stride] = 1;
}
_xend();
printf("success\n");
} else {
printf("failure\n");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.