I would like to know if there is a way to create the stack of a thread on a specific NUMA node. I have written this code but i'm not sure if it does the trick or not.
Thanks
Code:
pthread_t thread1;
int main(int argc, char**argv) {
pthread_attr_t attr;
pthread_attr_init(&attr);
char** stackarray;
int numanode = 1;
stackarray = (char**) numa_alloc_onnode(sizeof(char*), numanode);
// considering that the newly
// created thread will be running on a core on node1
pthread_attr_setstack(&attr, stackarray[0], 1000000);
pthread create(&thread1, NULL, function, (void*)0);
...
...
}
