根据临界区算法实现的抽烟者问题。考虑有三个吸烟者进程和一个经销商进程的系统。每个吸烟者连续不断地做烟卷并抽他做好的烟卷。做一支烟卷需要烟草、纸和火柴三种原料。这三个吸烟者分别掌握有烟草、纸和火柴。经销商源源不断地提供上述三种原料,但他只将其中的两种原料放在桌上,具有另一种原料的吸烟者就可做烟卷并抽烟,且在做完后给经销商发信号,然后经销商再拿出两种原料放在桌上,如此反复。试设计同步算法来描述他们的活动。
2021-07-03 17:34:51 191KB java gui
1
操作系统的实验课设,实现Dekker,Lamport,Peterson,Eisenberg进程互斥访问临界区算法,使用java语言完成,可以动态显示进程访问临界区时各个进程的状态
2021-05-05 17:09:40 106KB 操作系统 多进程
1
QT4 线程 临界区的使用 代码简洁 能说明QT下线程的使用 方法,代码有注释,易扩展
2021-04-25 09:12:38 3KB QT4 线程 临界区 互斥
1
临界区的互斥控制_SetEvent置句柄为有信号状态配合WaitForSingleObject使用_INFINITE等待其运行结束
2021-04-10 16:02:50 8KB 临界区 互斥 多线程
vc++ 多线程教程---线程通信--利用事件对象,线程同步--使用信号量,线程同步--使用互斥量,线程同步--使用临界区
2021-04-04 17:07:28 178KB 多线程
The Sleeping Teaching Assistant A university computer science department has a teaching assistant (TA) who helps undergraduate students with their programming assignments during regular office hours. The TA’s office is rather small and has room for only one desk with a chair and computer. There are three chairs in the hallway outside the office where students can sit and wait if the TA is currently helping another student. When there are no students who need help during office hours, the TA sits at the desk and takes a nap. If a student arrives during office hours and finds the TA sleeping, the student must awaken the TA to ask for help. If a student arrives and finds the TA currently helping another student, the student sits on one of the chairs in the hallway and waits. If no chairs are available, the student will come back at a later time.
1
使用临界区来实现多线程的同步互斥.critical section
vc++中使用临界区CriticalSection的例子.zip
2021-03-28 12:05:31 7KB 临界区 多线程互斥
① 实现UP、DOWN原语 ② 产生3个进程,两个进程模拟需要进入临界区的用户进程。 当需要进入临界区时,显示:“进程x请求进入临界区…”,同时向管理进程提出申请; 申请返回,表示进入了临界区。在临界区中等待一段随机时间,并显示:“进程x正在临界区…”; 当时间结束,显示:“进程x退出临界区…”,同时向管理进程提出退出申请; 当申请返回,显示:“进程x已退出临界区。” ③ 一个进程作为原语的管理进程,接受其他进程的临界区进入请求: 如果允许进入,则根据DOWN 原语的操作步骤设置相应变量,然后返回; 如果不允许进入,则进入循环等待,直到允许为止; 退出时模拟UP 操作。 ④ 进程间通信可以采用信号、消息传递、管道或网络通信方式。
2020-01-03 11:22:43 58KB 临界区  实现UP、DOWN原语
1