Assignment1 - CSci 4061: Intro to Operating Systems...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CSci 4061: Intro to Operating Systems Assignment 1: Program-Graph Executor Due: February 15th by 10pm. You may work in a group of 2 or 3. Purpose: To develop a graphexec program in C that will execute a graph of user programs in parallel using fork, exec and wait in a controlled fashion. Such graphs are used in compiler analysis and parallel program execution to model control- and data-dependencies. A control dependence specifies that a program cannot start until its predecessor(s) is finished. A data dependency specifies that a program requires input from its predecessor(s) before it can execute. Description: Your main program graphexec will be responsible for analyzing a graph of user programs, determining which ones are eligible to run, and running programs that are eligible to run at that moment in time. As programs in the graph finish, your program will determine which other programs in the graph have become eligible to run, execute those programs, and continue this process until all programs are finished. In the example graph above, node 0 can be executed first because it is not a child of any other node. After node 0 finishes executing, then nodes 1 and 2 can be executed in parallel (they both should be started immediately without waiting for either 1 or 2 to finish). Only after both 1 and 2 finish can the final node 3 be executed. Each node in the graph represents one program to be executed. Each node will contain: the program name with its arguments, “pointers” to child nodes, the input file to be used as standard input for that program, and the output file to be used as standard output for that program. A node becomes eligible for execution once all of its parent nodes (nodes that contain a pointer to this node) have completed their own execution. Your main program will fork and exec each of the nodes as they become eligible to run. Also, input and output redirection must be used so that each node can get its standard input from a file and also write its output to a file (respectively). Graph File Format:
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 4

Assignment1 - CSci 4061: Intro to Operating Systems...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online