搜索资源列表
threadphilosopher
- 利用线程方案实现实现哲学家问题.设置五个信号量代表五把叉子,初使值均为1,表示5把叉子均可以取,设置五个线程代表5个哲学家,其值分别为0~4,规定奇数号的哲学家先拿起他左边的叉子,然后再去拿他右边的叉子 而偶数号的哲学家则相反.按此规定,将是1,2号哲学家竞争1号叉子,3,4号哲学家竞争3号叉子.即五个哲学家都竞争奇数号叉子,获得后,再去竞争偶数号叉子,最后总会有一个哲学家能获得两支叉子而进餐。而申请不到的哲学家进入阻塞等待队列,根FIFO原则,则先申请的哲学家会较先可以吃饭,因此不会出现饿死的
myCreatProcess
- 进程的创建 编写一段程序,使用系统调用fork()创建两个子进程。当此程序运行时,在系统中有一个父进程和两个子进程活动。让没一个进程在屏幕上显示一个字符:父进程显示字符“a”;子进程分别显示字符“b”和字符“c”。试观察记录屏幕上的显示结果,并分析原因。 -process for the preparation of the establishment of procedures, the use of system calls fork () to create two child p
Linux_envirnment_communication
- 该函数创建的管道的两端处于一个进程中间,在实际应 用中没有太大意义,因此,一个进程在由pipe()创建管道后,一般再fork一个子进程,然后通过管道实现父子进程间的通信-The function at the two ends of the pipeline to create a process in the middle, in practical applications is not much significance, therefore, a process by the pipe
ExecApp
- 執行程式後不需等待程式結束. 於批次檔中使用非常方便-Fork application and leave it alone. Convenience for execute application in batch file.
LinSocket
- The fork server helps to resolve the multi threading
chengxu
- 进程互斥进程同步 哲学家有N个,也定全体到达后开始讨论:在讨论的间隙哲学家进餐,每人进餐时都需使用刀、叉各一把,所有哲学家刀和叉都拿到后才能进餐。哲学家的人数、餐桌上的布置自行设定,实现刀和叉的互斥使用算法的程序实现。-The philosopher N, also all arrived to begin to discuss: in the discussion of the gap the dining philosophers, each table needs to use kni
pipe
- A)编写myls在既定的文件中列出当前工作目录文件的个性化列表(每行一个文件目录包括inode 号,硬链接数,文件名,大小,最近修改时间),不需要排序。并且报告处理花费的总时间(屏幕显示)。 B)Process – model ( fork() + exec() + pipe() ): parent 进程:产生 child 进程,接受并显示 child 进程传回的信息。 child 进程:调用 exec(),执行 A) 中的myls可执行文件(将所花费的时间报告给父进程)。 -a
2
- 设计并实现Unix的“time”命令。“mytime”命令通过命令行参数接受要运行的程序,创建一个独立的进程来运行该程序,并记录程序运行的时间。 在Windows下实现: • 使用CreateProcess()来创建进程 • 使用WaitForSingleObject()在“mytime”命令和新创建的进程之间同步 • 调用GetSystemTime()来获取时间 在Linux下实现: • 使用fork()/execv()来
ionsistency
- 操作系统实习报告编写一段程序,使用系统调用FORK创建两个子进程-Operating system internship report. Write a program to use the FORK system call to create two child process