This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Starvation in cyg_libc_stdio_flush_all_but()?
- From: Robin Farine <acnrf at dial dot eunet dot ch>
- To: ecos-discuss at sources dot redhat dot com
- Date: 03 Dec 2001 10:27:11 +0100
- Subject: [ECOS] Starvation in cyg_libc_stdio_flush_all_but()?
Hi,
Under some circumstances, my application's UI freezes but background threads
still run. The following scenario causes it to happen:
1. Two threads; one, called CLI, handles the command line interface. The
second, say WRK, does some work and prints messages to the console.
2. priority(CLI) > priority(WRK) (higher priority, not higher value)
3. While WRK is printing a message to stdout, the user hits RETURN which
causes the CLI thread to wake up and display a prompt to stderr. This ends
in cyg_libc_stdio_flush_all_but() with the CLI thread looping endlessly
trying to flush stdout since WRK owns stdout stream's lock and cannot
release it because of its lower priority.
Did anyone already have this problem? Do the current CVS sources fix it?
Thanks,
Robin