Is there any way to run a POSIX thread with a predetermined cpu affinity? I am using pthread_setaffinity_np right now but the problem with that approach is that it only works with a thread that is already created. pthread_setaffinity_np simply moves the thread to another cpu if the current cpu that it is running on does not match the cpu mask passed in. If my pogram is constantly creating worker threads this seems like unnecessary overhead. You have no control over what cpu the thread actually starts on. Is there any way to set the cpu on which a POSIX thread will start as a result of calling pthread_create?