To answer a part of your question:
If you want to adjust your thread priorities you can use pthread_attr_setschedparam
pthread_attr_t thread_attributes;
pthread_attr_init(&thread_attributes);
struct sched_param params = {.sched_priority = 15}; // Set higher/lower priorities in other threads
pthread_attr_setschedparam(&thread_attributes, ¶ms);
pthread_create(&pThreadID1, &thread_attributes, vUserInterfaceThread, NULL);