Commit 8870b011 authored by nextime's avatar nextime

Make shure threads will run on the same core as the calling thread

parent 734367ff
......@@ -33,7 +33,7 @@ typedef struct
/* Define globally accessible variables and a mutex */
#define NUMTHRDS 2
#define NUMTHRDS 10
#define VECLEN 100000
DOTDATA dotstr;
pthread_t callThd[NUMTHRDS];
......
......@@ -43,7 +43,7 @@ int pthread_create(pthread_t *thread,
int ret;
cpu_set_t mask; /* Define your cpu_set bit mask. */
CPU_ZERO(&mask); /* Initialize it all to 0, i.e. no CPUs selected. */
CPU_SET(0, &mask); /* set the bit that represents core 0. */
CPU_SET(sched_getcpu(), &mask); /* set the bit that represents core 0. */
//targs.arg = arg;
//targs.fn = start_routine;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment