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: Wade Tregaskis <email@hidden>
- Date: Thu, 25 Jul 2002 11:15:51 +1000
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.
Yes, that's what I meant. Sorry for the lack of clarity. :)
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.
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...
But, this from a newbie. I intend on acquiring some classic texts on this
subject [general OS level operations] - can anyone name one or two that
stand out?
_______________________________________________
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.