Reply to post: Re: SSD can increase power use of a laptop

Why solid-state disks are winning the argument

AndrueC Silver badge

Re: SSD can increase power use of a laptop

The CPU spends less time waiting for the disk to spin and more time doing something useful.

If the CPU is waiting for a peripheral there is something wrong with the hardware or the OS. It's true that at the highest level most applications still use synchronous I/O for disks but that's just laziness or ignorance on the part of the programmer.

Here's how to do asynchronous reads using the Windows API.

Underneath the covers Windows will be doing everything asynchronously regardless. If a thread asks for a synchronous read Windows just blocks it and gets on with other threads until the read actually completes. The ability to block a thread while waiting for I/O has been a cornerstone of multi-tasking on PCs since the 1990s.

Now it might be that a given application has nothing better to do (eg;a text editor can't do anything until the disk has served up the text) but while that application is blocked the CPU will be doing work for other applications, services or whatever housekeeping tasks it's got queued up for just such moments. In fact it's possible for I/O to be too fast. If the OS never gets time to do the housekeeping because of short turnaround I/O the overall performance could suffer.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon