PDA

View Full Version : Write Behind Disk Cache " The reason why some Programs stop working"


ReadMeToo
03-04-2008, 11:05 PM
Write-behind caching.

Versions of Windows published since about 2000 have a feature called 'write behind caching'. Depending on your version (and Service Pack) of Windows, it may be enabled by default. The intention is to speed up operations, but read on...
What is write behind caching?
When you File a drawing, or use the Windows Save... or Save As... menus, your intention is to write your work to a disk drive - either a local or a network drive. What recent Windows systems actually do is 'make a note of the fact' that your intention is to create or modify a disk file, then save your information somewhere in memory, and only actually write it to the disk drive at some later time. It is part of this caching system that a program is unable to determine that this is going on, and so your program, in this case Accucadd, is 'convinced' that it has successfully committed your work to disk when in fact it's sitting someplace else, and potentially vulnerable to loss or corruption.
Since for most people the increase in performance is actually negligible, the risk of data loss far outweighs any benefit. We therefore recommend that you disable write-behind caching on all your disk drives. You'll find instructions below for Windows 3.1 (http://www.accucadd.com/TechNotes/Cache/WriteBehindCache.htm#3.1), 95/98 (http://www.accucadd.com/TechNotes/Cache/WriteBehindCache.htm#95), NT (http://www.accucadd.com/TechNotes/Cache/WriteBehindCache.htm#NT), ME (http://www.accucadd.com/TechNotes/Cache/WriteBehindCache.htm#95), XP (http://www.accucadd.com/TechNotes/Cache/WriteBehindCache.htm#XP), 2000 - 2003 (http://www.accucadd.com/TechNotes/Cache/WriteBehindCache.htm#2000).
How might this affect you?
We have had a number of reports of problems with drawings that we think are caused by (or at least related to) this issue. In some cases the drawing in question was destroyed, so this can be a very serious issue. The problem usually shows itself when a drawing that was filed in one session had errors when trying to load it in the next session. A related problem concerns drawings that are visible in the pictorial index (and in fact perfectly OK) but lack an active 'handle' to use for loading or inserting the drawing.
Disabling write behind caching

The following information is taken from an article on the web site of the Government of South Australia Dept. of Education and Children's Services, School Library Software Support Centre IT Services, Australia.
"Most Windows systems, by default, have write-behind caching enabled. This speeds up disk-write operations by holding data in memory until the computer thinks it is the right time to write it to disk.

This same system can also cause conflicts with shared files and networked software .... Because the data is not being written directly to the hard drive on the spot, delays imposed by caching can cause a server or workstation to become confused and to cause data corruption.

If this happens, the computer’s 'disk write caching' functions should be disabled.

The process to disable write caching is different for various versions of Windows.


Windows 95/98/ME
Start at the desktop.
Right-click on My Computer, then left-click on Properties.
Click on the Performance tab at the top.
Click on the File System button at the bottom.
Click on the Troubleshooting tab at the top.
Click on Disable write-behind caching for all drives to put a tick next to it.
Make sure it is ticked.
Click on OK to close the File System window.
Click on OK to close the System Properties window.

(Also check for the existence and content of the config and autoexec files, below (http://www.accucadd.com/TechNotes/Cache/WriteBehindCache.htm#3.1).)

Windows 2000 & 2003
Start at the desktop.
Right-click on My Computer, then left-click on Properties.
Click on the Hardware tab at the top.
Click on the Device Manager button.
Click on the + next to Disk Drives to expand it.
Right click on the hard drive on which to turn write caching off, then left click Properties.
Click on the Disk Properties tab.
Click on Write Cache Enabled to remove the tick. It must not be ticked.
Click OK.

Windows XP
Start at the desktop.
Right-click on My Computer, then left-click on Properties.
Click on the Hardware tab at the top.
Click on the Device Manager button.
Click on the + next to Disk Drives to expand it.
Right click on the hard drive on which to turn write caching off, then left click Properties.
Click on the Policies tab.
Click on Enable write caching on the disk to remove the tick. It must not be ticked.
Click OK.


Smartdrive
Windows 95, 98 and ME can be set to start the computer by using the Config.Sys and Autoexec.Bat files. The Smartdrive facility can be included here, which also can control write-behind caching. It is a good idea to have these files on the computer on Win 95/98 systems. Windows 3.11 systems must have these files and they should be similar.

The Config.Sys file should look like:

DEVICE=C:\WINDOWS\HIMEM.SYS
DOS=HIGH,UMB
DEVICE=C:\WINDOWS\EMM386.EXE NOEMS
BUFFERS=32
FILES=64
DEVICEHIGH=C:\WINDOWS\SETVER.EXE
STACKS=9,256

The Buffers and Files commands must be large enough to handle all the files that multiple Bookmark users may want to have open at one time. This can be up to 6 files for each computer accessing the server – e.g. 6 x 10 or 60 files, for 10 workstations, for example.

The Autoexec.Bat file should look like:

@ECHO OFF
PATH=C:\;C:\WINDOWS;C:\WINDOWS\COMMAND
LH DOSKEY
LH \WINDOWS\SMARTDRV.EXE /X

The /X on the Smartdrv command disables wirte-behind caching on all drives."
A related tech note appears on the Microsoft site (http://windowsupdate.microsoft.com/). This is a vast site, and it can be difficult to find things on it, so here's a portion of the relevant information:
"The Windows IDE Hard Drive Cache Package provides a workaround for computers running Windows Millennium with Integrated Drive Electronics (IDE) hard drives, large caches, and modern processors. IDE hard drives store data in a hardware cache (temporary memory) and write the data to the hard disk later. For these computers, data can be lost during the shutdown process because the amount of time that it takes for fast processors to shut down is so short that the hard disk may shut down before the data in the cache is written to the hard drive. This update introduces a two second delay in the shutdown process, which allows the hard drive's cache to write any data to the hard drive. Download now to delay your shutdown process slightly to prevent data loss."

Windows NT4
As far as we know there is no user interface provided to the write-behind caching feature in Windows NT. Data from Microsoft suggest that you need to ensure that you are using Service Pack 4 or later, and that you need to check the value of the registry entry:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Servic es\Rdr
\Parameters\UseWriteBehind
The value 0 (zero) disables write behind caching. It is not clear what state the system is in if this key is not present.

We do not encourage you to edit the registry. Messing with the registry is not a good idea unless you are confident that you know what you are doing. Making incorrect registry entries can cause your Windows operating system, or application programs, to act improperly or stop working. We make no warranties for the instructions given in the Microsoft article referenced above, or for the registry entries reproduced on this (or any other) web page. You agree to make any and all registry changes at your own risk. Consult your local expert!

Summary Article from Accucad website
I suggest you review all the above material, and consider the advisability of making changes to your system.

ReadmeTooŽ

Smduff
03-04-2008, 11:10 PM
Very good info here RM2

ReadMeToo
03-04-2008, 11:13 PM
I aim to please and hope solve issues we experience here and earn my keep, LOL

Smduff
03-04-2008, 11:17 PM
You always do buddy:great