Re: How do disk writes work these days?
torsdagen den 25 juli 2002 kl 03.15 skrev Wade Tregaskis: Is this still an efficient way of operating, in an increasingly linear [e. g. single-user] OS? I'm just thinking, if you could return from writes faster, the calling process can keep doing other things. My thought is that you could do this without breaking existing apps by performing any error checking [i.e. quickly verifying there is free space, among other things] immediately, returning fail if appropriate, or otherwise returning no error. You could then worry about physically getting the data to disk, seeing as this is the most time intensive part... Side note: I was taught that if you know how large a file you want to write you should use ftruncate() to set the file size before writing. That way the OS can optimize the location of the file on the hard drive. I've noticed Unix application are quite bad at doing this, so perhaps it doesn't apply in some OSes. -- Pelle Johansson <morth@morth.nu> _______________________________________________ darwin-kernel mailing list | darwin-kernel@lists.apple.com Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/darwin-kernel Do not post admin requests to the list. They will be ignored.
participants (1)
-
Pelle Johansson