Subject:
|
Re: threads - bug in the firmware?
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Thu, 17 Jan 2002 22:08:03 GMT
|
Viewed:
|
1956 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:
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 (...) (23 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
|
|
|
|