Thread programming basics (threads are dynamic by nature). See man pthread_cancel.
Basic thread operations:
http://www.llnl.gov/computing/tutorials/pthreads/
pthread_setschedparam() is used to change priority. It has an assoicated call,
pthread_getschedparam() . Try the man page for each for examples.