J4 ›› 2016, Vol. 38 ›› Issue (02): 269-276.
• 论文 • Previous Articles Next Articles
GAO Sheng,CHEN Yuefeng
Received:
Revised:
Online:
Published:
Abstract:
Aiming at the dining philosophers problem, a wellknown classical example of the inter process of communication in the operating system field, this paper designs and presents a technical implementation scheme for a representative algorithm. The scheme takes Linux as its supporting platform, and the scheme reflects the characteristics of the concurrent behaviors of philosophers through processes rather than threads. The state of the philosophers and the switch between two states are emulated and controlled by the combination of automatic and random modes, which is a flexible and natural humancomputer interaction mode. Two forms of state monitoring programs are presented, which can express the state of philosophers in a vivid, direct and accurate way. The characterbased monitoring program can be used in both the character terminal and the graphic terminal, and is mainly used for those users who log in the multiuser Linux systems. The animationbased monitoring program is suitable for the desktop Linux users with graphic terminal.
Key words: operating system;process synchronization and mutual exclusion;semaphore;shared memory;dining philosophers problem;state monitoring program
GAO Sheng,CHEN Yuefeng. Implementation of an algorithm for the dining philosophers problem [J]. J4, 2016, 38(02): 269-276.
0 / / Recommend
Add to citation manager EndNote|Ris|BibTeX
URL: http://joces.nudt.edu.cn/EN/
http://joces.nudt.edu.cn/EN/Y2016/V38/I02/269