To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.rcx.legosOpen lugnet.robotics.rcx.legos in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / RCX / legOS / 3426
3425  |  3427
Subject: 
Threads within threads
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Wed, 27 Aug 2003 19:32:36 GMT
Viewed: 
3229 times
  
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
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR