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: cyg_thread_delay() trace!!


On Thu, 2003-09-11 at 21:02, Satish Kumar wrote:
> Hi,
>     i have programmed a timer for HAL_CLOCK_XXX routines..and when a 
> cyg_thread_delay(x) is called in the twothreads.c program, therez no
> response. my program hangs..!!
>            can some body list out the trace how the HAL_CLOCK_XXXX
> macros are called when i invoke a cyg_thread_delay(x) function. i m not
> able to trace out clearly after it enters the sched.cxx file...

The call to 'cyg_thread_delay()' really has nothing to do with calls
to HAL_CLOCK_XXX.  What happens is your thread will be suspended (unable
to execute) pending the occurrence some number of clock ticks.  If there
are no other threads which can run at this point, then the idle thread
will be run.  In any case, when a clock interrupt occurs, 
HAL_CLOCK_RESET() will be called as part of the processing and a tick
will have taken place.  When enough ticks have gone by, your original 
thread will be allowed to resume, thus returning from the 
'cyg_thread_delay()' call.  Pretty standard, interrupt driven 
multi-threaded operations.

-- 
Gary Thomas <gary@mlbassoc.com>
MLB Associates


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


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