Bug 57140 - fflush can be simplified
Summary: fflush can be simplified
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: eCos
Classification: Retired
Component: C library
Version: CVS
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Jonathan Larmour
QA Contact: Jonathan Larmour
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-12-05 18:21 UTC by Jonathan Larmour
Modified: 2007-04-18 16:38 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2003-06-20 16:07:03 UTC
Embargoed:


Attachments (Terms of Use)

Description Jonathan Larmour 2001-12-05 18:21:43 UTC
Description of Problem:

From the thread "Fix fflush starvation [#57014]" on ecc-target-changes:

> But I don't see how your change manages this at all.  It seems to me
> that if you enter this [loop] with some other thread holding the lock,
> you'll try once and fail and then immediately just do the
> lock-with-wait.  Or, am I missing something?


The idea was that you may go enter this loop with a stream already locked,
and someone else may do the same, resulting in a potential deadlock.

However, I've just noticed that this is a difference between my[1] code and
the pthread code. In my code Cyg_StdioStream::refill_read_buffer will
already have flushed the stream, whereas in the pthread code, the code in
question deals with all the streams (including the one already locked).

I'll open a bugzilla bug, as I'm not sure exactly what would happen with
!CYGSEM_LIBC_STDIO_WANT_BUFFERED_IO. Right now it would break, but flushing
should be mostly a nop anyway. At the very least, flush_output_unlocked
should call cyg_stdio_flush in that case which it doesn't.

Comment 1 Alex Schuilenburg 2003-06-20 16:07:03 UTC
This bug has moved to http://bugs.ecos.sourceware.org/show_bug.cgi?id=57140


Note You need to log in before you can comment on or make changes to this bug.