﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	field_blocks	field_dependson	field_seealso
201	fflush() should be cheap if output buffer is empty	Jiri Svoboda		"Currently a non-standard synchronization scheme is used for the console. The console/fb drivers assume that they can delay screen update until an explicit sync operation. This sync operation is achieved via fsync(). fflush() calls fsync() every time.

In POSIX fflush() only writes out (flushes) the output buffer (if it is non-empty). But it does not sync the file descriptor, fsync() is a stronger operation. Terminal output in POSIX is updated immediately when data is written to the file descriptor.

The big problem in HelenOS is that fflush() is expensive (does fsync(), which results in IPC) even when there is no data in the output buffer. This contributes to the slowness of operations such as fgetc() which try to flush output streams (and currently do it always, not just when we are reading from stdin).

Another question is, whether it would be better to make the console behavior more standard, so that an fsync() is not necessary.
"	enhancement	new	major		helenos/unspecified	mainline						
