同时对硬盘进行 2 个或更多读取/写入

发布于 2024-11-26 04:07:37 字数 157 浏览 3 评论 0原文

据说硬盘中只有一个主轴负责向硬盘读取或写入数据,怎么可能同时向硬盘写入或读取2个或更多数据呢?使用的操作系统是Windows XP。例如,我需要将两部不同的电影从笔式驱动器复制到硬盘,所以我单击两部电影从笔式驱动器复制它们并将它们粘贴到磁盘分区中,将两部电影复制到硬盘的过程同时发生。这是怎么发生的?

it is said that there is only one spindle in hard disk which reads or writes data to/from hard disk, how is it possible to write or read 2 or more data's to/from hard disk SIMULTANEOUSLY. the operating system used is windows xp.EXAMPLE, i need to copy two different movies to hard disk from pen drive so i click both movies copy them from pen drive and am pasting them in a disk partition, coping process of two movies to hard disk occurs simultaneously. how does this happen?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

不必在意 2024-12-03 04:07:37

这些操作根本不是同时进行的,但操作系统同时管理这两个操作。

发生的情况是文件管理器(例如,Windows 资源管理器)告诉操作系统将文件从一个位置复制到另一个位置,两次复制操作各一次。

操作系统将该命令分解到其自身系统的两个部分:“文件系统”和“磁盘驱动程序”。文件系统计算出哪个磁盘上的哪些块与相关的特定文件相关联,并告诉磁盘驱动程序读取或写入这些块。

磁盘驱动程序建立一个读取和写入队列,并找出满足它们的最有效方法。桌面操作系统通常会尝试快速处理这些请求,以使系统尽可能响应,但服务器操作系统会尽可能长时间地对块操作进行排队,以便能够按照允许的顺序处理它们最有效地利用块排序。

一旦磁盘驱动程序决定执行块操作,它就会告诉磁盘移动其磁头并读取或写入一些数据。然后,操作的结果被传回文件系统,并最终传回用户应用程序。

操作同时出现的事实只是操作系统的多任务处理功能的幻觉。这很容易辨别,因为多个文件副本比单个副本花费的时间稍长(或者有时很多更长,如果您试图同时做一堆文件。)

当然,如果两个单独的驱动器确实是不同的磁盘,操作系统仍然能够同时移动它们。

These operations aren't simultaneous at all, but the operating system manages both operations concurrently.

What happens is the file manager (say, windows explorer) tells the operating system to copy file from one location to another, once each for the two copy operations.

The operating system breaks this command across two parts of its own system, the "filesystem" and the "disk driver". The file system works out what blocks on what disk are associated with the particular files in question, and tells the disk driver to read or write to those blocks.

The disk driver builds up a queue of reads and writes and figures out the most efficient way to satisfy them. A desktop operating system will usually try to service those requests quickly, to make the system as responsive as possible, but a server operating system will queue up the block operations as long as possible so that it can handle them in an order that allows it to make the most efficient use of block ordering.

Once the disk driver decides to act on a block operation, it tells the disk to move it's head and read or write some data. The result of the action is then passed back to the filesystem, and ultimately to the user application.

The fact that the operations appear simultaneous is only an illusion of the multitasking facilities of the operating system. This is pretty easy discern since multiple file copies take a little longer than just one copy (or sometimes a LOT longer, if you're trying to do a bunch at the same time.)

of course, the OS is still able to move two separate drives simultaneously if they really are different disks.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文