This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Question about scheduler & sleep
- From: jyl087 at netscape dot net
- To: ecos-discuss at sources dot redhat dot com
- Date: Fri, 16 Aug 2002 19:07:44 -0400
- Subject: [ECOS] Question about scheduler & sleep
In my application, I have a section of code which is surrounded by
cyg_scheduler_lock/unlock. Now, within that section, I call
cyg_thread_delay(128). My intention is to have a 128 tick pause,
without allowing context switching.
When I step through the code with GDB, I find that the code does
pause, however, when it returns from the cyg_thread_delay, the
thread is still in the SLEEPING state. It actually continues to
execute until the cyg_scheduler_unlock() is called, at which point
it goes into a deep sleep...
In summary:
cyg_scheduler_lock(); RUNNING
...
cyg_thread_delay(128); SLEEPING
... SLEEPING, but executing code!
cyg_scheduler_unlock(); SLEEPING, and really dead
Question... is this a bug in the thread mechanism, or is my
use of the library wrong?
Thanks
/Jim
__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/
Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss