[ECOS] Question about scheduler & sleep
jyl087@netscape.net
jyl087@netscape.net
Fri Aug 16 16:07:00 GMT 2002
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
More information about the Ecos-discuss
mailing list