This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: cyg_thread_delay() trace!!
- From: Gary Thomas <gary at mlbassoc dot com>
- To: Satish Kumar <satish at bvt dot sc dot sanyo dot co dot jp>
- Cc: eCos Discussion <ecos-discuss at sources dot redhat dot com>
- Date: 11 Sep 2003 21:08:39 -0600
- Subject: Re: [ECOS] cyg_thread_delay() trace!!
- Organization: MLB Associates
- References: <20030912115723.8738.SATISH@bvt.sc.sanyo.co.jp>
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