- 1、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
中断处理c版(Interrupthandling,cversion)
中断处理c++版(Interrupt handling, c++ version) #包括 iostream。” #包括程序。” typedef struct { 国际年; 月; 国际日; 小时; INT MIN; int秒; int毫秒; }时间; typedef struct PCB { 名称[ 10 ];//进程名 积分时间;/ /需要服务时间 在时间/时间片; 结构板下; } *队列; 时间,*时间;/ /时间为当前准确时间,时间为进程从中断开始到进程运行结束的时间 PCB * createpcbnode();/ /创建进程 Queue CreatePcbQueue(队列);/ /创建就绪队列 时间* frunnian(时间* T);/ /闰年计时 时间*润年(时间* T);/ /平年计时 *运行时间(时间* T);/ /进程运行时间 插入(队列头,PCB×Q);/ /插入进程 空切(PCB * L,int数);/ /中断响应 无效的显示(PCB *头);/ /显示队列 无效displayt(时间);/ /显示时间 布尔空间(PCB * P) { 如果(P)返回1; 其他的 { cout endl “空间申请失败 endl!!!”; 返回0; } } 无效main() { 队列头; int数= 0; 时间=(时间*)malloc(sizeof(时间)); 时间=(时间*)malloc(sizeof(时间)); 时间-年=时间-月=时间-天=时间-小时= 0; 时间- min =时间-秒=时间-毫秒= 0; 头=(PCB *)malloc(sizeof(PCB)); 头-下= null; cout “====================中断处理事件模拟====================” endl; / /置开机时间 cout “输入现在的时间,格式为:--年--月--日--时--分--秒 endl。”; CIN 时间年 时间月 时间天 时间小时时间 秒时间min; 时间-毫秒= 0; displayt(时间); cout endl; 头= CreatePcbQueue(头); / /中断处理 为(int i = 0;i 100;i++) { cout endl “...... ......” endl “已经执行了一条指令” endl; cout “请输入中断的信息(1”中断,0不中断)“ endl; CIN 我; 如果(我= = 1) { cout “中断响应:“ endl; 计数+ +; 切(头数); 如果(头-下= = null) { cout “所有进程已运行完毕!模拟结束” endl; 退出(0); } } 如果(我= = 0) cout “没有中断产生” endl; } } * createpcbnode() PCB { PCB×Q; Q =(PCB *)malloc(sizeof(PCB)); 如果(!空间(q))的出口(2); ch; cout “请依次输入进程的进程名、需要服务时间(正整数):”; CIN Q Q名字-时间; Q 时间= 3; 而(Q—时间= = 0) { cout “需要服务时间须为正整数!请按“Y”或“Y”重新创建(其他退出):”; CIN CH; if (ch = = y | | ch = = y) { court 请依次输入进程的进程名、需要服务时间 endl:; cin q - name q - time; q - timep = 3; } else { q = null; break; } } return q; } void insert (queue head, pcb * q) { pcb * p; p = head; while (p - next! = null) p = p - next; p - next = q; q - next = null; } queue (queue createpcbqueue head) { pcb * q; char ch; court 创建请按 endl y 或 y (其他则退出):; cin ch; while ((ch = = y | | ch = = y) { q = createpcbnode (); if (q) insert (head, q); court 继续创建请按 y 或 y (其他则退出):; cin ch; } return (head); } void display (pcb * head) { pcb * p; p = head; court endl; while (p - next) { p
您可能关注的文档
- 中国文学史知识点经编(Chinese literature history, knowledge point, warp knitting).doc
- 中国文学常识大放送,我自己收集的资料(The common knowledge of Chinese literature has been widely distributed and collected by myself).doc
- 中国文学文化知识集结(Knowledge accumulation of Chinese literature and culture).doc
- 中国文学常识(Common sense of Chinese Literature).doc
- 中国文学标准朗读(Standard reading of Chinese Literature).doc
- 中国新型航母一鸣惊人时间(The new aircraft carrier China blockbuster time).doc
- 中国新型系列高原工程装备世界首屈一指(China's new series of plateau engineering equipment is second to none in the world).doc
- 中国新年(春节)风俗与典故(Chinese New Year (Spring Festival) customs and allusions).doc
- 中国新形势(New situation in China).doc
- 中国新贵阶层的现实(九龙山)(Reality of China's upstart class (Jiulong Mountain)).doc
- 中文版游戏 - 4391单机网(Chinese version of the game - 4391 stand-alone network).doc
- 中断机制(Interrupt mechanism).doc
- 中日关系现状.doc
- 中心机房及配电系统设计(Central computer room and distribution system design).doc
- 中日关系问题难以用沟通解决(The problem of Sino Japanese relations is difficult to communicate).doc
- 中式残名(Chinese style name).doc
- 中日各大时尚潮流杂志的在线观看地址(China and Japan fashion trends magazine online watch address).doc
- 中断异常处理流程(Interrupt exception handling flow).doc
- 中日饮食比较中文(Comparison of Chinese and Japanese diet).doc
- 中星6b卫星必威体育精装版参数(New parameters of Zhongxing 6B satellite).doc
有哪些信誉好的足球投注网站
文档评论(0)