
Hello Ion, I would like to use the interprocess library and some NPTL features (pthread_setaffinity_np => assign a thread to a cpu) at the same time. The pthread_setaffinity_np function is declared in /usr/include/nptl/pthread.h (on my developer platform), but throughout the interprocess/boost headers I can find #include <pthread.h> ... which makes me think that /usr/include/pthread.h is included. Can I simply swap in the interprocess .hpp files the include statements to this: #include <nptl/pthread.h> ... or do you know of a cleaner solution? I'm asking you this, because I'm using a trimmed down boost library (interprocess + bare minimum from the rest of boost) and only in the interprocess headers do I see pthread.h inclusion. Furthermore, I will have to link against /lib64/tls/libpthread-2.3.4.so... do you foresee a problem with that? Many thanks, Szilard

Szilard Pataki escribió:
Hello Ion,
I would like to use the interprocess library and some NPTL features (pthread_setaffinity_np => assign a thread to a cpu) at the same time. The pthread_setaffinity_np function is declared in /usr/include/nptl/pthread.h (on my developer platform), but throughout the interprocess/boost headers I can find
#include <pthread.h>
... which makes me think that /usr/include/pthread.h is included. Can I simply swap in the interprocess .hpp files the include statements to this:
#include <nptl/pthread.h>
... or do you know of a cleaner solution?
From your words I guess that <pthread.h> and <ntpl/pthread.h> are incompatible and you can only include one of them (maybe each one refer to a different pthread implementation)? If so, you could just add the "/usr/include/nptl/" to the front of your include directories (-I option in gcc) so that #include <pthread.h> includes ntpl/pthread.h instead of pthread.h. That supposing ntpl/pthread.h has all the needed pthread declarations (since NTPL is an implementation of pthread, I suppose that should be true) used by Interprocess. Or am I missing something? Regards, Ion
participants (2)
-
Ion Gaztañaga
-
Szilard Pataki