找回密码
 注册
快捷导航
查看: 1519|回复: 2

【请教】计算机专业或者懂操作系统的XD请进...

[复制链接] |自动提醒
阅读字号:

3507

回帖

29

积分

1万

资产值

白金会员 Rank: 3Rank: 3Rank: 3

注册时间
2006-3-24
发表于 2007-2-17 12:51:06| 字数 1,676| - 美国–德克萨斯州–卡梅伦–拉古纳维斯塔 Charter_Communications | 显示全部楼层 |阅读模式
上课都听得懂...但是出来的题目就是不明白要我做什么...大家帮忙看看...

In this assignment, you will implement a program to  handle  con-
current  processes which perform arithmetic operations.
This is especially applicable for execution in dual or quad-core
computer systems.

You will learn concepts from  several  computer  science  discip-
lines, including compilers, data flow architecture, parallel com-
putation, and, of course, operating systems.  The input to your
program is illustrated by the following example:

  main()
  {  input_var a,b,c,d;
     process_var p1,p2,p3,p4;
         
     read(a,b,c,d);
     cobegin
        p1 = a + b;
        p2 = c - d;
        p3 = a + 2;
     coend;
     p4 = p1 * (p2 + p3);
     write(a,b,c,d,p1,p2,p3,p4);
  }

The syntax of the concurrent program follows that of C with the
following extensions.

input_var declares input variables to be read by your program
using "read".   process_var  declares  process  variables
whose  values  will be computed a process you create.  There will
be a distinct process to handle the calculation for each  process
variable.  Statements within a cobegin-coend pair can be executed
concurrently.  Therefore, processes  which  compute  the  process
variables  in  these  concurrent  statements can be executed con-
currently.
            In the above example, processes to compute the values
of p1, p2, and p3 can be executed concurrently.  However, these 3
processes must complete before the process for computing  p4  can
start. There can be several levels of nesting cobegin-coend pairs
and your program should parse these  statements  correctly. There
may be one level of parantheses in one arithmetic operation, and
this also imposes precedence constraints on the processes'
arithmetic operations.

You may want to create an  internal precedence graph to store the
dependencies among the  processes.   To  synchronize  these  con-
current processes, you are to use Unix semaphores.  The output of
your program consists of a printout of the values  of  all  input
and process variables as specified by "write".


有任何idea都好哦!!!
ThinkPad X41 2525F2C
MacBook Pro MA897LL/A HD Matte
Dell UltraSharp 2408WFP

3507

回帖

29

积分

1万

资产值

白金会员 Rank: 3Rank: 3Rank: 3

注册时间
2006-3-24
 楼主| 发表于 2007-2-19 09:45:31| 字数 17| - 美国–德克萨斯州–卡梅伦–拉古纳维斯塔 Charter_Communications | 显示全部楼层
顶上去!!! 任何方向指引都好哦!!
ThinkPad X41 2525F2C
MacBook Pro MA897LL/A HD Matte
Dell UltraSharp 2408WFP
回复 支持 反对

使用道具 举报

5545

回帖

64

积分

9112

资产值

钻石会员 Rank: 3Rank: 3Rank: 3

注册时间
2003-3-2
铜牌荣誉勋章(注册8年以上会员)银牌荣誉勋章(注册10年以上会员)
发表于 2007-2-19 09:50:35| 字数 289| - 中国–浙江–绍兴–嵊州市 电信 | 显示全部楼层
题都能出这么长,我PF老美了.
问题是不是在这段,偶看不懂.
You may want to create an  internal precedence graph to store the
dependencies among the  processes.   To  synchronize  these  con-
current processes, you are to use Unix semaphores.  The output of
your program consists of a printout of the values  of  all  input
and process variables as specified by "write".
X31 PM1.5G/768M/5K120/2100B※T43 14.1UXGA※T60 T7200/1G/5400.3/14.1SXGA※X61 7673-LQ2 12.1SXGA+
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Powered by Discuz! X3.5 © 2001-2023 Comsenz Inc

GMT+8, 2025-10-29 12:19 , Processed in 0.066437 second(s), 28 queries , Gzip On, OPcache On.

手机版|小黑屋|安卓客户端|iOS客户端|Archiver|备用网址1|备用网址2|在线留言|专门网

返回顶部