Try adding some calls to yield() or sleep() inside the threads.
The tight loops in the code don't give the OS time to get control and pass control to another thread.
Type: Posts; User: Norm
Try adding some calls to yield() or sleep() inside the threads.
The tight loops in the code don't give the OS time to get control and pass control to another thread.
ThreadA is started first and finishes immediately. ThreadC has not been started yet.
You need the threads to do something that takes longer so that their priority can have an effect.
What do you expect the output should be and why?
The code is trivial and will probably execute immediately when started.
Please edit your post and wrap your code with
<YOUR CODE HERE>
to...
Can you post a small, complete program that compiles, executes and shows what you are asking about.
Can you post a small program that compiles, executes and shows what you are asking about.