首页 > 试题广场 >

Consider the following I O sc

[单选题]
Consider the following I /O scenarios on a single-user PC.

For each of these I/O scenarios,would you design the operating system to use buffering,spooling,caching,or a combination? Would you use polled I /O,or interrupt-driven I /O? Give reasons for your choices.


  • A mouse used with a graphical user interface
  • A tape drive on a multitasking operating system (assume no device preallocation is available)
  • A disk drive containing user files
  • A graphics card with direct bus connection,accessible through memory-mapped I /O
推荐

a.A mouse used with a graphical user interface

Buffering may be needed to record mouse movement during times when higher-priority operations ane taking place.Spool-ing and caching are inappropriate.Interrupt driven I/O is most

appropriate.

b.A tape drive on a multitasking operating system (assume no device preallocation is available)

Buffering may be needed to manage throughput difference between the tape drive and the source or destination of the I /O,Caching can be used to hold copies of data that resides on the tape, for faster access. Spooling could be used to stage data to the device when multiple users desire to read from or write to it.Interrupt driven I /O is likely to allow the best performance.

c.A disk drive containing user files

Buffering can be used to hold data while in transit from user space to the disk,and visa versa.Caching can be used to hold disk-resident data for improved performance.Spooling is not necessary because disks are shared-access devices.Interrupt-driven I/O is best for devices such as disks that transfer data at slow rates.

d.A graphics card with direct bus connection, acessible through memory-mapped I/O

Buffering may be needed to control multiple access and for performance(double-buffering can be used to hold the next screen image while displaying the current one). Caching and spooling are not necessary due to the fast and shared-access natures of the device.Polling and interrupts are only useful for input and for I/O completion detection,neither of which is needed for a memory-mapped device.

发表于 2018-03-25 10:21:39 回复(0)
给英文不好的同学,来个中文的,大家顶一下,让更多的同学们看到,谢谢各位了
a.鼠标与图形用户界面一起使用
在高优先级操作发生的时候,可能需要缓冲来记录鼠标移动。池化和高速缓存不合适。中断驱动的I / O是最合适的。
b.多任务操作系统上的磁带驱动器(假定没有设备预分配可用)
可能需要缓冲来管理磁带驱动器与I / O的源或目的地之间的吞吐量差异,缓存可用于保存驻留在磁带上的数据的副本,以加快访问速度。当多个用户希望读取或写入数据时,假脱机可用于将数据传送到设备。中断驱动的I / O可能会实现最佳性能。
c。包含用户文件的磁盘驱动器
当从用户空间传输到磁盘时,缓冲可用于保存数据,反之亦然。缓存可用于保存磁盘驻留数据以提高性能。因为磁盘是共享访问设备,所以不需要使用缓冲池。中断驱动I / O最适合以低速传输数据的磁盘等设备。
d。具有直接总线连接的图形卡,可通过内存映射I / O访问
缓冲可能需要控制多个访问和性能(双缓冲可用于保持下一个屏幕图像,同时显示当前的)。由于设备的快速和共享访问特性,高速缓存和假脱机并不是必需的。波动和中断仅用于输入和I / O完成检测,这两种都不是内存映射设备所需要的。
编辑于 2018-06-04 11:01:05 回复(1)
在单用户PC上考虑以下I / O场景。在这些I / O场景中的,你是否会将操作系统设计为使用缓冲,假脱机,缓存或它们的组合?你会使用轮询I / O还是中断驱动的I / O?给出你选择的理由。

a.鼠标与图形用户界面一起使用
b.多任务操作系统上的磁带驱动器(假定没有设备预分配可用)
c.包含用户文件的磁盘驱动器
d.具有直接总线连接的图形卡,可通过内存映射I / O访问

所以这是一道简答题?
发表于 2018-11-16 21:32:37 回复(1)