v******F 发帖数: 61 | 1 1) On a traditonal UNIX system, how many times data is copied when system
read()s a file from disk and send()s it across the network?
2)Consider a singly linked list of the form
F -> A -> B -> C -> D ->E ::= | |
::= |
::= |
::= a|b|c|...|y|z
::= 0|1|2|...|9
Which of the following lexical entities can be derived from ? (Zero or more
answers may be correct.)
1. word
2. words
3. c22
4. 42
5. None of the above.
请解析一下你的答案。 谢谢大家 |
r*******e 发帖数: 7583 | 2 1)个人理解,Unix的memory space分为user space和kernel space
用户程序调用read()这个system call的时候,产生一个软中断
kernel的中断服务程序从设备读入数据到kernel space
然后调用 copy_to_user() 把数据copy到user space
同理,send()的本质和write()一样,先从user space复制到kernel space
然后再发送到network device
所以read()+send()至少要copy 4次
http://www.ibm.com/developerworks/linux/library/l-kernel-memory
http://www.makelinux.net/ldd3/chp-3-sect-7
more
【在 v******F 的大作中提到】 : 1) On a traditonal UNIX system, how many times data is copied when system : read()s a file from disk and send()s it across the network? : 2)Consider a singly linked list of the form : F -> A -> B -> C -> D ->E ::= | | : ::= | : ::= | : ::= a|b|c|...|y|z : ::= 0|1|2|...|9 : Which of the following lexical entities can be derived from ? (Zero or more : answers may be correct.)
|
v******F 发帖数: 61 | 3 光顾看答案,忘了说谢谢
有人可以帮帮忙第二题吗? |
p*****2 发帖数: 21240 | 4
第二题没看明白
【在 v******F 的大作中提到】 : 光顾看答案,忘了说谢谢 : 有人可以帮帮忙第二题吗?
|
v******F 发帖数: 61 | 5 我也没读懂。。。有机会问问出题的,我也答案会POST在这里
谢谢 |