Question

a) Write a C-program that creates a chain of 10 processes and prints out their process...

a) Write a C-program that creates a chain of 10 processes and prints out their process ids and relationships. For example, process 1 is the parent of process 2, process 2 is the parent of process 3, process 3 is the parent of 4 and so on. Each child has to print out all her ancestors identified by the process ids.

b) Write a C-program that creates a fan of 10 processes. That is, process 1 is the parent of prcocesses 2, 3, 4, 5, 6 and so on.

(Using Linux C++)  

0 0
Add a comment Improve this question Transcribed image text
Request Professional Answer

Request Answer!

We need at least 10 more requests to produce the answer.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the answer will be notified once they are available.
Know the answer?
Add Answer to:
a) Write a C-program that creates a chain of 10 processes and prints out their process...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Similar Homework Help Questions
  • Write a “C” program that creates a child process that prints out its pid and new...

    Write a “C” program that creates a child process that prints out its pid and new line and then calls pause() system call. Once it returns from the pause system call the child program must exit with code 5. The parent program must wait for the child process and print out the pid of the child process and the exit status with the following format: “childpid=%d,exitstatus=%d\n”.

  • Part 2. System Programming and Process Management You are asked to develop basic system programmi...

    Can someone help me create this program for Linux. Part 2. System Programming and Process Management You are asked to develop basic system programming including process creation and termination on a Linux platform in this part of programming project. You are asked to create multiple children processes to work under one parent process. In theory, children processes can do their own work separately or cooperatively to accomplish a task. In this assignment, these children processes simply print out a "hello"...

  • You are required to write a C program on Unix/Linux in which the parent process creates...

    You are required to write a C program on Unix/Linux in which the parent process creates three child processes, lets them run concurrently, and waits for them to return and prints their exit status. The three child processes are assigned different tasks. Child one is to calculate and display the highest mark of a class of ten students for a unit. Child one is required to get the marks from the standard input (i.e. the keyboard). Child two is to...

  • How to Write a C program (for Linux/Unix) that: –Creates a struct, where each instance can...

    How to Write a C program (for Linux/Unix) that: –Creates a struct, where each instance can store one message. –Forks a process. –Creates 2+ messages, with contents of your choice, in the parent and sends them to the child via a named or anonymous pipe. –Prints the contents of all received messages in the child process. –If necessary, cleans up after the pipe. Note (the subjects about signal and Pipes )

  • Write a program in C using the fork() system call to do the following. The parent process (main program) forks a process...

    Write a program in C using the fork() system call to do the following. The parent process (main program) forks a process (CHILD 1) to compute and print the sum of first n integers where n is a variable shared between the parent and CHILD 1. It also forks another process (CHILD 2) that finds the sum of squares of the first n numbers where n is a variable it shares with the parent. Let CHILD 1 print “The sum...

  • Write a C program that has a local and a global variable. The program uses a...

    Write a C program that has a local and a global variable. The program uses a fork to create a child process. The parent process modifies both variables to be 10 and 20 and prints out the values. Then the child process modifies both variables to be 100 and 200 and prints out the values? Explain the program output?

  • Write a C program for Linux called pipes.c that does the following: In the main() function,...

    Write a C program for Linux called pipes.c that does the following: In the main() function, it creates a pipe using the pipe() function, then creates two child processes with fork(). Child 1 redirects stdout to the write end of the pipe and then executes with execlp() the "ps -aux" command. Child 2 redirects its input from stdin to the read end of the pipe, then it executes the "sort -r -n -k 5" command. After creating both children, the...

  • (In Unix) Make a C program that creates a zombie child process. Both parent and child...

    (In Unix) Make a C program that creates a zombie child process. Both parent and child processes should execute the command "ps" to show the current process list. (1) ** Copy and paste your code in your report. ** (2) Take a screen shot that shows the defunct information generated by "ps".

  • Please I need help with this problem Write a c++ program that will accept the names...

    Please I need help with this problem Write a c++ program that will accept the names of 3 processes as command-line arguments. Each of these processes will run for as many seconds as (PID%10)*3+5 and terminate. After those 3 children terminated, the parent process will reschedule each child. When all children have been rescheduled 3 times, the parent will terminate. Each child must print out its process id every time it runs.

  • For Linux Operating System: Write a simple test program in C to find out PIDs of...

    For Linux Operating System: Write a simple test program in C to find out PIDs of ALL ancestor (i.e., parent, grandparent ) processes of the current process or a given process specified by a PID. A parent process's PID of a given process pid can be found in /proc/$pid/status

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT