We are here with you hands in hands to facilitate your learning & don't appreciate the idea of copying or replicating solutions. Read More>>

Looking For Something at vustudents.ning.com? Click Here to Search

www.bit.ly/vucodes

+ Link For Assignments, GDBs & Online Quizzes Solution

www.bit.ly/papersvu

+ Link For Past Papers, Solved MCQs, Short Notes & More


Dear Students! Share your Assignments / GDBs / Quizzes files as you receive in your LMS, So it can be discussed/solved timely. Add Discussion

How to Add New Discussion in Study Group ? Step By Step Guide Click Here.

+ How to Follow the New Added Discussions at Your Mail Address?

+ How to Join Subject Study Groups & Get Helping Material?

+ How to become Top Reputation, Angels, Intellectual, Featured Members & Moderators?

+ VU Students Reserves The Right to Delete Your Profile, If?


See Your Saved Posts Timeline

Views: 213

.

+ http://bit.ly/vucodes (Link for Assignments, GDBs & Online Quizzes Solution)

+ http://bit.ly/papersvu (Link for Past Papers, Solved MCQs, Short Notes & More)

+ Click Here to Search (Looking For something at vustudents.ning.com?)

+ Click Here To Join (Our facebook study Group)

Replies to This Discussion

Today is last date anyone given helping idea.........

Please Discuss here about this assignment.Thanks

Our main purpose here discussion not just Solution

We are here with you hands in hands to facilitate your learning and do not appreciate the idea of copying or replicating solutions.

CS703 - Advanced Operating Systems Assignment No. 1 Solution Fall 2016 Due Date: Nov 21, 2016

CS703 – Advanced Operating Systems

 

 

 

 

 

 

Assignment 1

 

 

 

 

Instructions to Solve Assignments

 

The purpose of the assignments is to give you hands on practice. It is expected that students will solve the assignments themselves. Following rules will apply during the evaluation of assignment.

 

  • Cheating from any source will result in zero marks in the assignment.
    • Any student found cheating in any two of the assignments submitted will be awarded "F" grade in the course.
    • No assignment after due date will be accepted.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Exercise Specification

 

The exercise here expands on the fan structure of simplefan.c through the development of a simple batch processing facility, called runsim. The runsim program takes exactly one command-line argument specifying the maximum number of simultaneous executions. Follow the outline below for implementing runsim. Write a test program called testsim to test the facility. Suggested library functions appear in parentheses.

 

  1. Write a program called runsim that takes one command-line argument.
  2. Check for the appropriate command-line argument and output a usage message if the command line is incorrect.
  3. Initialize pr_limit from the command line. The pr_limit variable specifies the maximum number of children allowed to execute at a time.
  4. Initialize the pr_count variable to 0. The pr_count variable holds the number of active children.
  5. Execute the following main loop until end-of-file is reached on standard input.
    1. If pr_count is pr_limit, wait for a child to finish (wait) and decrement pr_count.
    2. Read a line from standard input (fgets) of up to MAX_CANON characters and execute a program corresponding to that command line by forking a child (forkmakeargvexecvp).
    3. Increment pr_count to track the number of active children.
    4. Check to see if any of the children have finished (waitpid with the WNOHANGoption). Decrement pr_count for each completed child.
    5. After encountering an end-of-file on standard input, wait for all the remaining children to finish (wait) and then exit.

 

Write a test program called testsim that takes two command-line arguments: the sleep time and the repeat factor. The repeat factor is the number of times testsim iterates a loop. In the loop, testsim sleeps for the specified sleep time and then outputs a message with its process ID to standard error. Use runsim to run multiple copies of the testsim program.

 

Create a test file called testing.data that contains commands to run. For example, the file might contain the following lines.

 

        testsim 5 10
        testsim 8 10
        testsim 4 10
        testsim 13 6
        testsim 1 12

 

Run the program by entering a command such as the following.

 

        runsim 2 < testing.data

 

 

Provided Files

 

Following files are provided along with this assignment file.

 

makeargv.c: The makeargv function creates an argument array pointed to by argvp from the string s, using the delimiters specified by delimiters. If successful, makeargv returns the number of tokens. If unsuccessful, makeargv returns –1 and sets errno. You are required to use makeargv  function in runsim program and compile makeargv.c along with runsim.c.

 

simplefan.c: A program that creates a fan of n processes where n is passed as a command-line argument.

 

 

Submission Guidelines

 

  • You are required to submit the source files runsim.c and testsim.c.
  • You will also submit a one page readme.txt file describing how to compile and run your program correctly. If your program does not compile or run as per your own instructions, marks will be deducted.
  • You are encouraged to discuss the problem with your colleagues. However, you are not allowed to look at their code or help them in debugging.

 

 

Marks Distribution

 

runsim.c        40 marks

testsim.c.     05 marks

readme.txt    05 marks

 

 

Reference Book

 

Unix Systems Programming: Communication, Concurrency, and Threads by Kay A. Robbins and Steven Robbins

 

 

If you have any query regarding the assignment, contact at the course’s email address.

RSS

© 2020   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service

.