communication techniques bench: BUGFIX
* -s really make the threads to be on a shared cache
This commit is contained in:
parent
68589566a7
commit
33d217f3dc
|
@ -166,6 +166,20 @@ void *producer(void *cont_ptr_void)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
pthread_t tid;
|
||||||
|
cpu_set_t cpuset;
|
||||||
|
|
||||||
|
tid = pthread_self();
|
||||||
|
CPU_ZERO(&cpuset);
|
||||||
|
CPU_SET(2, &cpuset);
|
||||||
|
if (pthread_setaffinity_np(tid, sizeof(cpu_set_t), &cpuset))
|
||||||
|
{
|
||||||
|
perror("pthread_setaffinity_np");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
printf("Registering: %p !\n", (void*) pthread_self());
|
printf("Registering: %p !\n", (void*) pthread_self());
|
||||||
add_sender();
|
add_sender();
|
||||||
k = cont_ptr_void;
|
k = cont_ptr_void;
|
||||||
|
@ -207,7 +221,7 @@ void *receptor(void *a)
|
||||||
|
|
||||||
tid = pthread_self();
|
tid = pthread_self();
|
||||||
CPU_ZERO(&cpuset);
|
CPU_ZERO(&cpuset);
|
||||||
CPU_SET(1, &cpuset);
|
CPU_SET(0, &cpuset);
|
||||||
if (pthread_setaffinity_np(tid, sizeof(cpu_set_t), &cpuset))
|
if (pthread_setaffinity_np(tid, sizeof(cpu_set_t), &cpuset))
|
||||||
{
|
{
|
||||||
perror("pthread_setaffinity_np");
|
perror("pthread_setaffinity_np");
|
||||||
|
|
Loading…
Reference in New Issue