Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This homework focuses on learning how to create processes in Linux/Unix. 1. First study, understand and run the fork.c program provided. A simple hello.c is

image text in transcribed

This homework focuses on learning how to create processes in Linux/Unix. 1. First study, understand and run the fork.c program provided. A simple hello.c is also provided. You may wish to use the same or create a new hello.c program. The same hello program is being run in all the child processes. Modify the fork.c code to run a separate hello program in each of the child's process. (Hint: copy hello.c into hello1.c, hello2.c and hello3.c. Put some unique code in each hello.c, hello1.c, hello2.c and hello3.c. Compile them separately. Use the compiled object file, for eg, hello, hello1, hello 2 and hello 3 in forkc to modify it). Use comments where you modified the code. Submit a pdf file with the code and the output to BB. 2. Create a thread in a Java program and run it. The thread should read a keyboard value " x " and exit from the code, or it can also use an "ESC" to exit. That is, the thread should run until the keyboard exit character is entered. Print your source code and output to a single file and generate a pdf and submit it in Blackboard. Put your compile and run options if any in the code as comments. (20 points) 3. Using the above thread program, now create 10 threads in your program and run them. No need to wait for the keyboard in each thread, just print "Hello" and its thread id in each thread on a single line and exit. Append your source code and output to another pdf file. Add enough comments in your program to make it readable. (20 points)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning Databases With PostgreSQL From Novice To Professional

Authors: Richard Stones, Neil Matthew

2nd Edition

1590594789, 978-1590594780

More Books

Students also viewed these Databases questions