● Which of the following impacts the critical path?
A Changing the task duration.
B Reduce the free float of an activity.
C Executing a backward pass
D A or B
E None of the above.
第1题:
阅读以下技术说明和C语言代码,根据要求回答问题1至问题6。
【说明】
有两个进程(编号分别为0和1)需要访问同一个共享资源。为了解决竞争条件(race condition)的问题,需要实现一种互斥机制,使得在任何时刻只能有一个进程访问该共享资源。以下【C代码1】给出了一种实现方法。
【C代码1】
int flag[2]; /+flag数组,初始化为FALSE*/
Enter_Critical_Section(int my_task_id, int other_task_id)
{ while (flag[other_task_id]==TRUE); /*空循环语句*/
flag[my_task_id]=TRUE;
}
Exit_Critical_Section(int my_task_id, int other_task_id)
{ flag[my_task_id]=FALSE;
}
当一个进程要访问临界资源时,就可以调用【C代码1】给出的这两个函数。【C代码2】给出了进程0的一个例子。
【C代码2】
Enter_Critical_Section(0,1);
……使用这个资源……
Exit_Critical_Section(0,1);
……做其他的事情……
什么是临界资源(critical resource)?请用100字以内的文字简要说明。
第2题:
关于os.path子库,以下选项中用来计算相对路径的函数是:
A.os.path.basename(path)
B.os.path.relpath(path)
C.os.path.abspath(path)
D.os.path.normpath(path)
第3题:
阅读以下说明和C语言代码,回答问题1至问题4,将解答填入答题纸的对应栏内。
[说明]
有两个任务(编号分别为0和1)需要访问同一个共享资源,为了解决竞争条件(race condition)的问题,需要实现一种互斥机制,使得在任何时刻只能有一个任务访问该共享资源。代码一给出了一种实现方法。
[代码一]
1: int flag[2]; /* flag 数组,初始化为FALSE */
2: Enter_Critical_Section(int my_task_id, int other_task_id)
3: {
4: while (flag[other_task_id] == TRUE); /* 空循环语句 */
5: flag[my_task_id] = TRUE;
6: }
7: Exit_Critical_Section(int my_task_id, int other_task_id)
8: {
9: flag[my_task_id] = FALSE;
10: }
当一个任务要访问临界资源时,就可以调用代码一给出的这两个函数。代码二给出了任务0的一个例子。
[代码二]
Enter_Critical_Section(0,1);
…使用这个资源…
Exit_Critical_Section(0,1);
…做其他事情…
什么是临界资源(critical resource)?请用100字以内文字简要说明。
第4题:
关于os.path子库,以下选项中获得文件或目录最近一次修改时间的是:
A.os.path.getatime(path)
B.os.path.getctime(path)
C.os.path.getdtime(path)
D.os.path.getmtime(path)
第5题:
关于os.path子库,以下选项中用来计算相对路径的函数是:
A.os.path.normpath(path)
B.os.path.basename(path)
C.os.path.abspath(path)
D.os.path.relpath(path)
第6题:
第7题:
关于os.path子库,以下选项中用来计算相对路径的函数是:
A.os.path.abspath(path)
B.os.path.relpath(path)
C.os.path.normpath(path)
D.os.path.basename(path)
第8题:
A. followed,followed
B. followed,following
C. following,followed
D. following,following
第9题:
8、关于os.path子库,以下选项中用来计算相对路径的函数是:
A.os.path.relpath(path)
B.os.path.normpath(path)
C.os.path.basename(path)
D.os.path.abspath(path)
第10题:
关于os.path子库,以下选项中用来计算相对路径的函数是:
A.os.path.abspath(path)
B.os.path.basename(path)
C.os.path.normpath(path)
D.os.path.relpath(path)