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: Unable to put cyg_thread_delay


"Romil Shah" <rshah@slscorp.com> writes:

>  Sir,
>    I have created an application with 3 threads ,and attached a  delay for
> each of them the application is as follows,

> 
> Program get hang up if delay is attached to the thread_a ,but if it is
> commented and delay is attached to any other thread then program executes
> perfectly.
> SO what is the reason for this weired behaviour of cyg_thread_delay for
> thread_a.

You don't tell us what delayfun() does, which might be quite
important. I also assume that your stack sizes are adequate.

I doubt that this is any kind of problem with cyg_thread_delay()
itself. It is merely exposing some other problem. For example, thread
A is the lowest priority thread, so maybe it is getting starved. You
could try and raise its priority and see what happens.

Try adding some extra diag_print()s to more closely track what each
thread is doing. Use GDB to inspect the states of the three threads
and see where they actually are. There are lots of things you can do
to work out what's going on.

-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts




-- 
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]