首页> 美国政府科技报告 >Support Materials for Language and System Support for Concurrent Programming
【24h】

Support Materials for Language and System Support for Concurrent Programming

机译:支持并发编程的语言和系统支持材料

获取原文

摘要

The first example is an implementation in each of four languages (Ada, ConcurrentC, Co-Pascal, and occam) of the famous Dining Philosophers problem first stated by Dijkstra. In this metaphorical statement of deadlock and resource allocation problems, five philosophers sit around a circular table, in the center of which is a infinitely large bowl of Chinese food. To the left and right of each philosopher is a single chopstick; each philosopher must try to acquire both chopsticks, each for awhile, then put down the chopsticks and think for awhile; this cycle repeats for some total number of meals. (Dijkstra's original formulation used spaghetti and forks; we prefer the chopstick setting because most people can eat spaghetti with one fork.) The algorithm for chopstick selection must be chosen carefully, otherwise if all philosophers grab, say, their left chopsticks and refuse to yield them, all will starve. The second example is one we have used with repeated success at The George Washington University, namely a sort race in which the three different sorting methods are activated as processes. Each sort displays its progress in its window (usually a single row) on the terminal; mutual exclusion is necessary to protect the screen, which is a writable shared resource. We have found this example interesting and fun-there is a lot of screen activity, the problem being solved is obvious, and the three independent sorts serve as placeholders for any three independent applications contending for the processor and a shared data structure. (kr)

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号