模拟器程序设计 [英] Simulator program design

查看:92
本文介绍了模拟器程序设计的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我应该模拟操作系统如何使用C ++语言的信号量解决读者读写器问题.我花了3天的时间不停地工作(不是字面上的; P),因为它似乎没能完成工作,所以我想重新设计一个新的设计.有谁知道如何做这样的事情?
*程序应该具有读取器和写入器进程,但不一定必须是多线程的(我不知道如何在不使用我难以编程的线程的情况下拥有该线程).我所知甚少:((}
*程序应告知是否某个进程试图进入放置的关键部分而失败,因为另一个进程已经存在

请帮助我...我只有到星期一才能这样做:((<

Hello everyone,
I''m supposed to simulate how the operating system solves the reader writer problem using semaphores in c++ language. I spent 3 days working non-stop ( not literally ;P ) on it put it doesn''t seem to do the job so i''m thinking of starting over with a new design. Does any have any idea how to do such a thing??
* The program should have reader and writer processes yet it doesn''t necessarily has to be multi threaded { i don''t know how to have that without using threads which are so hard for me to program ->> i know so little :(( }
* The program should tell if a process tried to enter the critical section put couldn''t because another process is already there

please help me ... I only have till Monday to do it :((

推荐答案

如果您使用的是信号灯,则意味着需要进行线程化.就像您等了太久才a)做功课,b)改变您的方法一样.

If you''re using semaphores, that implies the need for threading. Looks like you waited too long to a) do your homework, and b) change your approach.


朋友,

我希望您在不打算使用多线程的情况下感到困惑.它可能是多处理的.总之,您最好弄清楚自己,因为如果在Windows或Linux上,资源利用率将由多个进程或线程组成.对于Symbian来说,它可能像是活动对象.另外,最好让自己疏通
Hi Friend,

I hope you are confused when they meant not to use multithreading..it could be multiprocessing..anyway better clear yourself as resource utilization will either be by multiple processes or threads if on Windows or Linux.If any other platform like embedded.. it could be something like active object in case of Symbian.ANyway, better to get yourself cleared


这篇关于模拟器程序设计的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆