`
isiqi
  • 浏览: 16489962 次
  • 性别: Icon_minigender_1
  • 来自: 济南
社区版块
存档分类
最新评论

Worse is better" -- Unix哲学之

 
阅读更多

本段文字介绍了Unix哲学之一:Worse is Better,同时本文还解释了为什么Unix阻塞系统调用可能会返回EINTR错误。

Richard P. Gabriel suggests that a key advantage of Unix was that it embodied a design philosophy he termed "Worse is better". In the "Worse is better" design style, simplicity of both the interface and the implementation is more important than any other attribute of the system — including correctness, consistency and completeness. Gabriel argues that this design style has key evolutionary advantages, though he questions the quality of some results.

For example, in the early days UNIX was a monolithic kernel (which means that user processes carried out kernel system calls all on the user stack). If a signal was delivered to a process while it was blocked on a long-term I/O in the kernel, then what should be done? Should the signal be delayed, possibly for a long time (maybe indefinitely) while the I/O completed? The signal handler could not be executed when the process was in kernel mode, with sensitive kernel data on the stack. Should the kernel back-out the system call, and store it, for replay and restart later, assuming that the signal handler completes successfully?

In these cases Ken Thompson and Dennis Ritchie favored simplicity over perfection. The UNIX system would occasionally return early from a system call with an error stating that it had done nothing - the "Interrupted System Call" - an error number 4 (EINTR) in today's systems. Of course the call had been aborted in order to call the signal handler. This could only happen for a handful of long-running system calls, i.e. read(), write(), open(), select(), etc. On the plus side, this made the I/O system many times simpler to design and understand. The vast majority of user programs were never affected because they didn't handle or experience signals other than SIGINT/^C and would die right away if one was raised. For the few other programs - things like shells or text editors that respond to job control keypresses - small wrappers could be added to system calls so as to retry the call right away if this EINTR error was raised. Problem solved, in a simple way.

更过Unix哲学,请看:http://en.wikipedia.org/wiki/Unix_philosophy

分享到:
评论

相关推荐

    操作系统分区分配算法first-fit ,next-fit,worse-fit模拟

    在这个项目中,我们关注的是三种经典的分区分配策略:First-Fit、Next-Fit和Worse-Fit。这些算法都是为了在有限的内存资源中尽可能优化内存的利用率。 First-Fit(首次适应算法): First-Fit是最简单的分区分配...

    小升初英语语法总结与习题集形容词和副词的比较级.doc

    西安是中国最古老的城市之一。 7. The **fewer** children there are in a family, the **better** their life will be. 家庭里的孩子越少,他们的生活将会越好。 8. It will be bad for your health to eat **...

    HARLEY HAHN'S GUIDE TO UNIX AND LINUX

    Whenever you use a computer it becomes, for better or for worse, an extension of your mind. This means that, over an extended period of time, the computer system you use changes how you think. Indeed...

    英语作文经典模板.doc

    To make matters worse, ----------A 的缺点之三." 在结论部分,作者可以提供个人见解,平衡地评价事物的利弊:"Through a balanced consideration of both advantages and disadvantages, I believe that ------....

    初中英语形容词、副词比较级、最高级专项练习(带答案).doc

    10. bad -> worse -> worst 11. thin -> thinner -> thinnest 12. far -> farther/further -> farthest/furthest 13. early -> earlier -> earliest 14. careful -> more careful -> most careful 15. exciting -> ...

    2022年 大学英语四级 作文预测 模板 25种题型全覆盖

    One of the important disadvantages is that ----------------(A 的第一个缺点).To make matters worse,------------------(A 的第二个缺点). Through the above analysis, I believe that the positive aspects ...

    基于KANO模型的运动健身APP用户需求分析及功能设计.pdf

    该模型将用户需求分类为三个 atributos:Must-Be、More-Is-Better、Attractive Quality。Must-Be是用户认为产品或服务必须具备的基本功能;More-Is-Better是用户认为产品或服务越好越好的性能;Attractive Quality是...

    四年级英语下册 Module6教案 外研版.doc

    在Unit 1中,教学目标是让学生掌握描述人或事物优劣的不规则比较级,如"This girl is good.","This boy is better than the girls."以及"This picture is bad."和"This picture is worse."。教学重点和难点在于理解...

    新概念1综合测试题.pdf

    - Tom was ill last week, he is much better now. - He had a bath when the telephone rang. - While I was cooking the dinner, he was reading the paper. - We would be disappointed if there is no snow for ...

    四年级英语下册 MODULE6 unit1(1)教案 外研版.doc

    - 让一个女孩唱英文歌,并在黑板上写下"The girl is good",然后写出"better, bad, worse, I think, I agree, voice, first",教授发音和用法,引导学生用每个单词造句。 - 自由交谈:让另一个女孩唱歌并说"The ...

    For Butter or Worse

    标题中提到的“For Butter or Worse”可以理解为一个双关语,一方面与“for better or worse”(好或坏)相似,另一方面“butter”一词在此处指的可能是流畅的用户体验,与“janky”或“choppy”(卡顿)相对。...

    比较级的用法总结90968PPT课件.pptx

    而表示辈分或排行时,old有不规则变化形式:old→elder→eldest,elder不能与than连用,例如She is my elder sister. 他是我的姐姐。He is my elder brother. 他是我的哥哥。He is my eldest son. 他是我的大儿子。 ...

    小学英语形容词比较级最高级重点讲解及练习.doc

    - good -> better -> best - bad -> worse -> worst - far -> further/farther -> furthest 在实际应用中,形容词的比较级和最高级常用于表达程度的对比,例如:"Tom is as tall as John."(汤姆和约翰一样高)...

    (外研版)小学四年级下册英语:第六模块Music重点句型和短语(精编版).pdf

    - 不规则变化的形容词比较级:bad-better-worst, many/much-more-most, little-less-least。 - 示例:I think this girl is better than the first girl. 2. **同意与不同意**: - 表达同意或不同意的句型:"Do ...

    高考英语写作模板.doc

    - "更糟糕的是"可表达为"What’s worse/ Even worse/ To make matters worse/ Worse still",用来强调问题的严重性。 - "更重要的是"可以用"More importantly/ What is more important is that------"来强调某个...

    八年级下暑期英语第二部分语法(2).doc

    1. 描述 A 用原级:A = B 表示 A 和 B 是一样程度的,例如 "She is as tall as her sister." 2. A 不如 B,如 "He is not as strong as his brother." 3. A > B:A 比 B 更...,例如 "She works harder than I do." ...

    四年级英语下册 MODULE6 unit1教案 外研版.doc

    和 Unit 2 Lingling is better than Daming. 两部分构成,旨在教授学生如何进行评价和比较,同时也涉及了音乐相关的背景知识。 教学目标: 1. 学习形容词的比较级,如:good - better,bad - worse。 2. 掌握不...

    英语形容词比较级和最高级讲解.doc

    有些形容词的比较级和最高级形式并不遵循上述规则,如"good - better - best","bad - worse - worst","far - farther/further - farthest/furthest"等。 在使用形容词的比较级和最高级时,我们有时会用到一些特定...

    形容词比较等级专练.doc

    This book is much better than that one. 这些练习涵盖了形容词比较级和最高级的基本用法,有助于学生掌握如何比较和描述事物的差异,提升他们的英语表达能力。在实际应用中,理解并正确使用这些语法结构对于准确...

    八年级上比较级和高级的用法PPT学习教案.pptx

    6. **不规则变化**:部分形容词和副词有特殊的比较级和最高级形式,例如:good - better - best, well - better - best, bad - worse - worst, far - farther/further - farthest/furthest。 三、特殊表达方式 1. *...

Global site tag (gtag.js) - Google Analytics