资源描述:
《基于多平台的通用线程库设计毕业设计》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、摘要跨平台是软件开发中一个重要的概念,即不依赖于操作系统,也不信赖硬件环境。一个操作系统下开发的应用,放到另一个操作系统下依然可以运行。相对而言如果某种计算机语言不用修改代码即可做到高度跨平台,那么此语言就越抽象,硬件控制力就越低,只适合开发高度抽象的模型系统。文中提到的当下比较流行的开源库如Boost,Qt,ZThreads,Ptypes,这些开发库各有各的侧重点,在性能和框架设计上各有不同,本文会依次简要分析这些开发库的设计原则,概括总结跨平台有两种实现方式,利用分支技术,或者利用动态平台识别,例如Java是一种提供运行环境
2、的跨平台解决方案,而C只是一种标准且严格的跨平台语言,本文就是主要探讨C的跨平台库实现。本文会简要分析几种跨平台的技术实现和区别,并通过对实现方法的总结,而借用一种叫做核心和路由的技术来实现跨平台库的构架,并给出相应实现,最后配上相应的演示功能程序。关键词:跨平台、开源库、Boost、线程库28AbstractCross-platformsoftwaredevelopmentisanimportantconcept,thatisnotdependentontheoperatingsystem,donottrustthehardw
3、areenvironment.Anoperatingsystemdevelopedundertheapplicationcanstillrunintoanotheroperatingsystem.IncontrastIfacomputerlanguagewithoutmodifyingthecodetoachieveahighdegreeofcross-platform,thenthemoreabstractlanguage,lowerhardwarecontrol,onlysuitableforthedevelopmentof
4、highlyabstractmodelsystem.CurrentpopularopensourcelibrariessuchasBoost,ofQt,ZThreads,Ptypes,eachofthesedevelopmentlibrarieseachfocusonperformanceandframedesigndifferent,thisarticlewillbefollowedbyabriefanalysisofthedesignprinciplesofthesedevelopmentlibraries,textsumm
5、arycross-platformimplementedintwoways,abranchoftechnology,ortheuseofadynamicplatformtoidentify,forexample,Javaisacross-platformoperatingenvironmentsolutions,andCisastandardandrigorouscross-platformlanguage,thispaperfocusesonCcross-platformlibrary.Thisarticleisabriefa
6、nalysisofseveralcross-platformtechnologyanddistinction,andsummaryoftheimplementation,andtoborrowatechniquecalledcoreandroutingtechnologytoachievecross-platformlibraryarchitecture,andgivesthecorrespondingimplementation,andfinallycoupledwiththecorrespondingdemoprogram.
7、Keywords:cross-platform,opensourcelibrary,Boostthreadlibrary28目录摘要1Abstract2第一章引言41.1研究背景41.2主要研究内容51.3论文结构5第2章跨平台软件开发环境62.1跨平台开发的历史62.2预处理器使用62.2.1例子1:Boost线程库72.2.2例子2:ZThreads线程库82.2.3预处理技术的比较92.2独立的开发分支102.3设计模式112.3.1桥接模式122.3.2抽象工厂模式13第3章跨平台库的设计153.1介绍153.2核心和路
8、由概述153.3应用范例17第4章跨平台线程库的设计和实现204.1线程跨平台的基础204.2总体框架设计214.3线程库结构化实现23第5章总结与展望285.1总结285.1展望28致谢29参考文献3028第一章引言1.1研究背景1991年Linux出现。短短