This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Problem in program :: Please Help
- From: Andrew Lunn <andrew at lunn dot ch>
- To: "R. Vamshi Krishna" <vamshi at cse dot iitb dot ac dot in>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: Tue, 2 Aug 2005 17:28:48 +0200
- Subject: Re: [ECOS] Problem in program :: Please Help
- References: <42EF88BB.6060804@cse.iitb.ac.in>
On Tue, Aug 02, 2005 at 08:22:43PM +0530, R. Vamshi Krishna wrote:
> Hello all,
>
> I am stuck up at a problem. This is what I wanted to do ::
>
> 1. An application runs in two different modes.
> 2. Each mode has 3 threads (distinct).
> 3. The application must switch modes at every 1000 ticks.
> 4. The individual threads of a mode will execute periodically.
>
> 5. I have tried to use an alarm to indicate that 1000 ticks are over.
> 6. Also each thread has its own alarm to indiacte that that it's
> period is over.
>
> Where have I gone wrong ??
Lots....
First of you are doing things in an alarm function you are not allowed
to do. See the documentation.
Secondly as the documentation says, you should only call
cyg_thread_delete on a thread that as existed.
The strucuture you currently have is very unsafe. I suggest you throw
away your current design and start again with something more sain.
Andrew
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss