Skip to content
Tcl Source Code Check-in [fe985089ac]
Login

Check-in [fe985089ac]

Overview
Comment: * All the changes below serve to fix bug [219148] which reports a 80x performance hit for file I/O on Win* systems. On my system it was closer to a 120x hit. Problem report by Uwe Traum <no email address available>. The fix goes like this: The obstacle is 'FlushFileBuffers', executed whenever Tcl writes data to the OS, as Tcl has to wait for the disk to complete I/O, and disks are slow. We remove that obstacle. This opens another problem, [file size] reports back wrong numbers. So for [file size] we add the call back in. As optimization we keep track of the channels which were written to and flush only these. * win/tclWinFile.c (TclpObjStat): Added a call to 'TclWinFlushDirtyChannels'. This ensures that [file size] and related commands report the correct size of a file even if Tcl has recently written to it. Unixoid OS's always report the correct size even for files with pending data, but Win* syssystem don't. They only report what is actually on disk. * win/tclWinInt.h: Added declaration of 'TclWinFlushDirtyChannels', making it available to other parts of the tcl core. * win/tclWinChan.c (TclWinFlushDirtyChannels): New, internal, procedure. Goes through the list of open file channels and forces the OS to flush its file buffers for all which were written to since the last call of this function. This is an expensive operation as Tcl has to wait for the OS to complete actual writes to the disk. (FileInfo): Added dirty flag required by the procedure above. (FileOutputProc): Removed flushing of file buffers, setting the dirty flag instead. This means that the previously incurred delays do not happen anymore. (TclWinOpenFileChannel): Added initialization of 'dirty' flag.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: fe985089acb1bfe378dd292be93a35f418114c35
User & Date: andreas_kupries on 2001-09-07 17:08:50.000
Other Links: manifest | tags
Context
2001-09-07
18:57
* win/tclWinThrd.c (TclpThreadExit): Cast status argument to _endthreadex to unsigned instead of D... check-in: 3c678e5d93 user: mdejong tags: trunk
17:08
* All the changes below serve to fix bug [219148] which reports a 80x performance hit for file ... check-in: fe985089ac user: andreas_kupries tags: trunk
02:43
* Updated http package to version 2.4, reflecting the new features just added. check-in: 6b6e834d7c user: dgp tags: trunk
Changes