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]

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


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