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 / 2220
2219  |  2221
Subject: 
Re: threads - bug in the firmware?
Newsgroups: 
lugnet.robotics.rcx.legos
Date: 
Thu, 17 Jan 2002 22:08:03 GMT
Viewed: 
1698 times
  
In lugnet.robotics.rcx.legos, Michael Obenland writes:
Hi Mike,

your problem is not because of an error in legOS. But what you do is that
you start your subroutines and then you leave main()! Leaving main means
that all your allocated memory is freed. The following will do the job:

Note also since bumper_task() is an infinite loop, and you never use pid1, you
could save one thread by doing this:

int main(int argc, char *argv[])
{
   pid2 = execi (&left_task,   0, NULL, PRIO_NORMAL+2, DEFAULT_STACK_SIZE);
   pid3 = execi (&right_task,  0, NULL, PRIO_NORMAL,   DEFAULT_STACK_SIZE);
   bumper_task();
   return 0;
}

However it will run at the default priority.

ROSCO



Message has 1 Reply:
  Re: threads - bug in the firmware?
 
Hi Ross (...) you (...) What are the advantages and disadvantages of this method as opposed to the one I used? mike (22 years ago, 18-Jan-02, to lugnet.robotics.rcx.legos)

Message is in Reply To:
  Re: threads - bug in the firmware?
 
Hi Mike, your problem is not because of an error in legOS. But what you do is that you start your subroutines and then you leave main()! Leaving main means that all your allocated memory is freed. The following will do the job: ---...--- cut here (...) (22 years ago, 17-Jan-02, to lugnet.robotics.rcx.legos)

18 Messages in This Thread:





Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact

This Message and its Replies on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

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