Subject:
|
Re: threads - bug in the firmware?
|
Newsgroups:
|
lugnet.robotics.rcx.legos
|
Date:
|
Thu, 17 Jan 2002 22:08:03 GMT
|
Viewed:
|
1698 times
|
| |
![Post a public reply to this message](/news/icon-reply.gif) | |
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:
![](/news/x.gif) | | 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: ![threads -Mike McFarlane (14-Jan-02 to lugnet.robotics.rcx.legos)](/news/x.gif) ![](/news/46.gif) ![Re: threads -Mike McFarlane (15-Jan-02 to lugnet.robotics.rcx.legos)](/news/x.gif) ![](/news/246.gif) ![Re: threads -Albert Huang (15-Jan-02 to lugnet.robotics.rcx.legos)](/news/x.gif) ![](/news/46.gif) ![Re: threads -Mike McFarlane (16-Jan-02 to lugnet.robotics.rcx.legos)](/news/x.gif) ![](/news/46.gif) ![Re: threads -Albert Huang (16-Jan-02 to lugnet.robotics.rcx.legos)](/news/x.gif) ![](/news/46.gif) ![Re: threads -Mike McFarlane (17-Jan-02 to lugnet.robotics.rcx.legos)](/news/x.gif)
![](/news/x.gif) ![](/news/x.gif) ![](/news/68.gif) ![Re: threads - bug in the firmware? -Mike McFarlane (16-Jan-02 to lugnet.robotics.rcx.legos)](/news/x.gif) ![](/news/246.gif) ![Re: threads - bug in the firmware? -Eric Swalens (16-Jan-02 to lugnet.robotics.rcx.legos)](/news/x.gif)
![](/news/x.gif) ![](/news/x.gif) ![](/news/68.gif) ![Re: threads - bug in the firmware? -Michael Obenland (17-Jan-02 to lugnet.robotics.rcx.legos)](/news/x.gif) ![](/news/246.gif) ![Re: threads - bug in the firmware? -Mike McFarlane (17-Jan-02 to lugnet.robotics.rcx.legos)](/news/x.gif)
![](/news/x.gif) ![](/news/x.gif) ![](/news/268.gif) ![You are here](/news/here.gif) ![](/news/46.gif) ![Re: threads - bug in the firmware? -Mike McFarlane (18-Jan-02 to lugnet.robotics.rcx.legos)](/news/x.gif) ![](/news/46.gif) ![Re: threads - bug in the firmware? -Ross Crawford (21-Jan-02 to lugnet.robotics.rcx.legos)](/news/x.gif)
![](/news/x.gif) ![](/news/x.gif) ![](/news/68.gif) ![Re: threads - bug in the firmware? -Michael Ash (18-Jan-02 to lugnet.robotics.rcx.legos)](/news/x.gif) ![](/news/46.gif) ![More on threads -Michael Obenland (18-Jan-02 to lugnet.robotics.rcx.legos)](/news/x.gif) ![](/news/46.gif) ![Re: More on threads -Mike McFarlane (19-Jan-02 to lugnet.robotics.rcx.legos)](/news/x.gif) ![](/news/46.gif) ![Re: More on threads -Michael Obenland (19-Jan-02 to lugnet.robotics.rcx.legos)](/news/x.gif) ![](/news/46.gif) ![Re: More on threads -Michael Ash (19-Jan-02 to lugnet.robotics.rcx.legos)](/news/x.gif)
- 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
|
|
|
|