Can anyone tell me the valid priority values? positive or negative??I have two threads spawning from the main() , say thread1 and thread2. thread2 always executes much faster than thread1. I want the other way round, because thread1 is much more important than thread2 in my program. Hence I was wondering if I should set higher priority to my thread1, thereby thread1 is executed more often and faster than thread2. Note:The processor is not too much of a good configuration neither does the computer have good memory. That could be another reason why threads cannot equally be efficient. However before giving up on the threading concept, I want to try with the thread priority. Please help.

jephthah commented: his first post. it's a legit question, doesn't need to go full red for that. +7
Ancient Dragon commented: hijack -5

welcome to daniweb. please familiarize yourself with the forum rules. you attract the ire of regulars when you bump old threads long dead with new questions, or otherwise "hijack" someone else's thread. Notice your question has been moved to it's own thread.

as to your problem .... pthreads.h and sched.h libraries are a common way to handle this:

the windows API has different method: