Re: How do disk writes work these days?
Re: How do disk writes work these days?
- Subject: Re: How do disk writes work these days?
- From: "Timothy A. Seufert" <email@hidden>
- Date: Wed, 24 Jul 2002 11:47:17 -0700
"Justin C. Walker" <email@hidden> wrote:
On Tuesday, July 23, 2002, at 07:18 AM, Wade Tregaskis wrote:
[for background, I don't have any experience coding at the kernel
level; I lurk on this list hoping to learn :)]
This is probably a numbingly boring question, but what happens when the
kernel gets handed data to write to disk, from say a userland app? I
ask because I've begun covering this from a users point of view in my
uni course, and they seem to indicate that the method, now as it was 30
years ago, is to block any disk write's and yield time to other
processes.
I don't recall any unix system in the past 30 years that did that. Disk
writes are scheduled by the I/O subsystem, and the driver handles
talking with the device to get the data there. All of this is
generally asynchronous with respect to process activity.
I think Wade meant "block [the calling process on] any disk writes
and yield time to other processes". Which is in fact what happens,
both now and 30 years ago.
Wade -- one thing you might want to look in to is that some operating
systems implement an asynchronous I/O API in addition to traditional
blocking synchronous I/O. For asynch, the difference in the sequence
of events (from userland POV) is that the initial I/O call doesn't
block, and there is always some mechanism to notify the process of
I/O completion. In "classic" MacOS, ISTR this was done by giving the
OS a pointer to a callback function, which would be called on error
or completion. I think it also set a flag in the descriptor
structure used to request the I/O, so you could also determine
completion by polling that flag.
--
Tim Seufert
_______________________________________________
darwin-kernel mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/darwin-kernel
Do not post admin requests to the list. They will be ignored.