|
Is it possible to use threads within threads?
In the example below (with all 6 threads having different priority levels),
how does the priority setting of each thread affect it being executed
earlier than other threads?
I mean, I assume that thread1 only competes with thread2 for priority and
thread3 only competes with thread4 for priority. ie. that threads monkey and
cow are run separately one after another, and when monkey is "paused" so are
thread1 and thread2 before continuing cow's execution.
If that makes any sense.
(Thanks)
int main(etc)
{
while(1)
{
execi(&monkey,etc);
execi(&cow,etc);
}
return 0;
}
int monkey(etc)
{
execi(thread1,etc);
execi(thread2,etc);
}
int cow(etc)
{
execi(thread3,etc);
execi(thread4,etc);
}
|
|
Message has 1 Reply: | | Re: Threads within threads
|
| (...) Have you tried to run this code? I wonder what will happen "in real life". Actually, main will start monkey and cow as fast as possible. I think this will crash your stack after a short while. Regards, Michael (21 years ago, 29-Aug-03, to lugnet.robotics.rcx.legos)
|
2 Messages in This Thread:
- Entire Thread on One Page:
- Nested:
All | Brief | Compact | Dots
Linear:
All | Brief | Compact
|
|
|
|