简体   繁体   English

计算 I/O 模型的值

[英]Calculating values for I/O models

Just wondering how do I got about calculating a few values for Programmed I/O, DMA and Interrupt-driven I/O models.只是想知道如何计算编程 I/O、DMA 和中断驱动 I/O 模型的一些值。

If an application needs to output 1000 words from the internal memory to the hard disk, how do I go about calculating the following values for for each I/O model:如果应用程序需要从内部存储器输出 1000 个字到硬盘,我如何为每个 I/O 模型计算以下值:

  1. The number of times, the processor is interrupted?多少次,处理器被中断?
  2. The number of times, the internal memory is read by the processor for those 1000 words?处理器读取内部存储器的次数为这 1000 个字?
  3. The number of times, times the disk controller is read by the processor?处理器读取磁盘控制器的次数?
  4. The number of times the disk controller is written to by the processor?处理器写入磁盘控制器的次数?

Thanks!谢谢!

这取决于处理器字长、磁盘总线上的字长、需要在中断中处理什么样的元数据、正在使用什么样的处理器缓存,......关于平台的零信息,什么都不是说过。

In programmed I/O: there will be no interrupts but 1000 read commands and 1000 write commands.在已编程的 I/O 中:将没有中断,只有 1000 个读命令和 1000 个写命令。

In interrupt driven I/O: there will be 1000 interrupts, 1000 read commands and 1000 write commands.在中断驱动的 I/O 中:将有 1000 个中断、1000 个读命令和 1000 个写命令。

In DMA: there will be only one interrupt, 1 read command and 1 write command for the transfer of whole block of memory在DMA中:整个内存块的传输只有1个中断,1个读命令和1个写命令

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM