Create a main program that accept as command line parameter

Assignment Help C/C++ Programming
Reference no: EM131103993

Create a main program (C or C++) in Linux that will accept (as a command line parameter) a number of seconds that the main process is to run, as well as a number of work processes to be created. The function of the main program will be to create a number of new work processes that will generate prime numbers starting at a given number. (For example, if I create 3 processes, the first would identify primes from 1000 to 2000, the second would identify pri mes from 2000 to 3000, etc.) .When the main program starts, it should start an alarm timer set to the length of time specified on the command line. The main program should then create the desired number of new processes and assign a "range" to each. At this point, the program is multiprocessing. I should have several active processes running in the kernel. I should use an alarm timer and a signal handler to catch a signal when the alarm times out. After the main process has created all of its processes, it needs to wait around until the timer expires. When the timer expires the main program should explicitly kill all of its child processes and then terminate itself. The output should be as below: In process 1 found another prime number 1009 A new process is created with process id 32177 In process 2 found another prime number 2003 A new process is created with process id 32178 In process 3 found another prime number 3001 A new process is created with process id 32179 Number of processes created from this program is 3 In process 1 found another prime number 1013 In process 2 found another prime number 2011 In process 3 found another prime number 3011 In process 1 found another prime number 1019 continued

Reference no: EM131103993

Questions Cloud

What will happen to the amount of apples : What will happen to the amount of apples and oranges that you choose to consume? Explain.
Write a research paper about suicide : Write a research paper about Suicide. Complete the following assignment by filling in all pertinent areas of research. You will need to utilize SPSS for this assignment. You may complete this assignment using the variables and topic.
Tools & techniques of financial planning : 1.  Rahul and Miranda want to make a lump-sum investment for their newborn's college education, and their goal is to accumulate $80,000 in 18 years. What is the amount they must invest today to reach their goal if the annual rate of return is 8%?
What impact will the substitution effect and income effect : What impact will the substitution effect and income effect have on the quantity demanded of coffee if coffee is an inferior good? Explain.
Create a main program that accept as command line parameter : Create a main program (C or C++) in Linux that will accept (as a command line parameter) a number of seconds that the main process is to run, as well as a number of work processes to be created. The function of the main program will be to create a nu..
Estimate the average number of cigarettes smoked per person : Use the regression line to estimate the average number of cigarettes smoked per person in 2001, to the nearest integer. Show some work. In what year (to the nearest year) does the regression line estimate an average number of cigarettes smoked per p..
How would you go about deciding whether person : How would you go about deciding whether person A or person B gets more personal benefit from each of the following:
Which likely to be nearly perfect complements explain : Which of the pairs of goods above is likely to be nearly perfect substitutes and which likely to be nearly perfect complements? Explain.
Vendor sells newspapers and tries to maximize profits : A news vendor sells newspapers and tries to maximize profits. The number of papers sold each day is a random variable. However, analysis of the past month's data shows the distribution of daily demand in Table 16. A paper costs the vendor 20¢. The..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd