I/O的定义是什么,哪些动作被归类为I/O? [英] What is the definition of I/O, and what actions are classified as I/O?

查看:133
本文介绍了I/O的定义是什么,哪些动作被归类为I/O?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在研究linux缓存时,我发现我一直在使用I/O一词,却不知道它的正确定义.

When I was studying about linux cache, I found that I've been using the term I/O without knowing its proper definition.

我引用关于Linux页面缓存的回复给我,"Linux内核在执行I/O时(而不是在打开文件时)填充(并使用)页面缓存"

I quote from someone who responded to me about Linux page cache, "Linux kernel populates (and uses) page cache when you are doing i/o, not when you open a file"

基本上,我将术语I/O视为任何sys命令,但事实证明打开文件不被视为I/O.

Basically, I treated the term I/O as any sys command, but turns out opening a file is not considered I/O.

此外,很少对I/O的定义进行在线讨论或记录.

Furthermore, the definition of I/O is rarely discussed or documented online.

哪个导致了我的问题. I/O的定义是什么(尤其是在访问磁盘的情况下),哪些操作可以归类为I/O?

Which leads to my question. What is the definition of I/O (particularly in the context of accessing disks), and what actions can be classified as I/O?

推荐答案

I/O的定义是什么,哪些动作被归类为I/O?

What is the definition of I/O, and what actions are classified as I/O?

这是一个没有明确答案的问题. (1)取决于系统(在Linux规范的帮助下),并且(2)取决于透视图.从用户的角度来看是输入/输出吗?一个过程?内核?

This is a question that has no definitive answer. (1) It depends upon the system (aided here by your specification of Linux) and (2) it depends up on the perspective. Is it Input/Output from the perspective of a user? A process? The kernel?

从进程的角度来看,人们可能会说linux中的I/O是使用读取或写入系统服务的任何操作.从这种意义上讲,OPEN不是I/O,因为它不是在读取或写入过程数据.

From the perspective of a process one might say I/O in linux is any operation using the read or write system services. In that sense an OPEN is not I/O because it is not reading or writing process data.

即使是定义也不能解决写入屏幕的问题(但您要求将焦点放在磁盘上).

Even definition does not account for writing to screen (but you asked to focus on disk).

但是,如果您改变对内核的看法,那么I/O的范围就会扩大.一个FILE打开请求可能需要读取一个或多个目录的内容并读取磁盘上的头文件信息.因此,磁盘和内存之间的任何数据移动都可以视为I/O.

However, if you change your perspective to that of the kernel the scope of I/O expands. a FILE open request might require reading the contents of one or more directories and reading header file information on the disk. Thus, any movement of data between disk and memory could be considered I/O.

从用户的角度来看,I/O是将数据移入或移出处理器的任何事物.那是理论上的.如上所述,计算机可以通过更新视频内存将文本写入屏幕.在这里可以在主存储器和视频存储器之间进行区分,但是从逻辑上讲,没有真正的数据移动.

From a user perspective, I/O is anything that moves data in or out of the processor. That's more theoretical. As I mentioned above, a computer can write text to a screen by updating video memory. One might make the distinction here between main memory and video memory but from a logical sense there is no real movement of data.

这篇关于I/O的定义是什么,哪些动作被归类为I/O?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆