This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Problem in program :: Please Help


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]