高级操作系统高级操作系统 (25).pdf

上传人:刘静 文档编号:57975029 上传时间:2022-11-06 格式:PDF 页数:8 大小:174.29KB
返回 下载 相关 举报
高级操作系统高级操作系统 (25).pdf_第1页
第1页 / 共8页
高级操作系统高级操作系统 (25).pdf_第2页
第2页 / 共8页
点击查看更多>>
资源描述

《高级操作系统高级操作系统 (25).pdf》由会员分享,可在线阅读,更多相关《高级操作系统高级操作系统 (25).pdf(8页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。

1、第 5 讲:The Interface of OS第四节:How to design a Linux kernel interfaceIntroduction.IntroductionMoral 1:diverse user usagestry to imagine the ways in which anarmy of inventive user-spaceprogrammers might(ab)use yourAPI3.5 MQ changes also broke user space in at least twoplacesIntroduced hard limit of 102

2、4 on queues_max,Fixedby commit f3713fd9cSemantics of value exported in/dev/mqueue QSIZEfield changed.IntroductionMoral 2:unit testswithout unit tests you will screw upsomeones APIRegressions happen more often than youd expectLinux 2.6.12 silently changed meaning of fcntl()F_SETOWNNo longer possible

3、to target signals at specific threadin multithreaded processInotify IN_ONESHOT flagBy design,IN_ONESHOT did not cause anIN_IGNORED event when watch is dropped afterone eventFrom 2.6.36,IN_ONESHOT does causeIN_IGNORED.IntroductionMoral 3:Specification,Andrew MortonProgramming is not just an act of te

4、lling a computerwhat to do:it is also an act of telling otherprogrammers what you wished the computer to do.Both are important,and the latter deserves care.recvmmsg()timeout argument needed a specification;something like:timeout is NULLtimeout points to 0,0timeout points to a structure which is nonz

5、ero.If,while blocking,the call is interrupted by a signalhandler.IntroductionMoral 4:feedback loopStrive to shorten worst-case feedback loop.Publicize API design as widely+early aspossible.Ideally,do all of the following before API release:Write a detailed specificationWrite example programs that fu

6、lly demonstrate APIEmail relevant mailing lists and,especially,relevantpeople,CC linux-apivger.kernel.orgwrite an LWN.net article.IntroductionMoral 5:into real worldOnly way to discover design problems in anew nontrivial API is by writing complete,real-world application(s)Writing a“real”inotify appl

7、icationBack story:I thought I understood inotifyThen I tried to write a“real”application(500 linesof C with(lots of)comments)Written up on LWN(https:/ understood all the work that inotify still leavesyou to do.IntroductionMoral 6:technical checklistNew system calls should allow for extensibility.Undefined arguments and flags must be zero.Syscalls with timeouts should allow absolutetimeoutsAvoid extending multiplexor system calls,etc.

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 教育专区 > 大学资料

本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知得利文库网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

工信部备案号:黑ICP备15003705号-8 |  经营许可证:黑B2-20190332号 |   黑公网安备:91230400333293403D

© 2020-2023 www.deliwenku.com 得利文库. All Rights Reserved 黑龙江转换宝科技有限公司 

黑龙江省互联网违法和不良信息举报
举报电话:0468-3380021 邮箱:hgswwxb@163.com