In Sec. 4.7.5, it was pointed out that on an exec call, by testing for an adequate
Question:
In Sec. 4.7.5, it was pointed out that on an exec call, by testing for an adequate hole before releasing the current process’ memory, a suboptimal implementation is achieved. Reprogram this algorithm to do better.
Data from Sec. 4.7.5
Transcribed Image Text:
When a command is typed at the terminal, the shell forks off a new process, which then executes the command requested. It would have been possible to have a single system call to do both fork and exec at once, but they were provided as two distinct calls for a very good reason: to make it easy to implement I/O redirection. When the shell forks, if standard input is redirected, the child closes standard input and then opens the new standard input before executing the com- mand. In this way the newly started process inherits the redirected standard input. Standard output is handled the same way. Exec is the most complex system call in MINIX 3. It must replace the current memory image with a new one, including setting up a new stack. The new image must be a binary executable file, of course. An executable file may also be a script that must be interpreted by another program, such as the shell or perl. In that case the file whose image must be placed in memory is the binary of the interpreter, with the name of the script as an argument. In this section we discuss
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 75% (4 reviews)
plaintext 1 Check permissions Ensure that the file is executable 2 Read the header to get the segmen...View the full answer
Answered By
Akash Goel
I am in the teaching field since 2008 when i was enrolled myself in chartered accountants course
Since then i have an experience of teaching of class XI, XII, BCOM, MCOM, MBA, CA CPT.
5.00+
1+ Reviews
10+ Question Solved
Related Book For
Operating Systems Design And Implementation
ISBN: 9780131429383
3rd Edition
Authors: Andrew Tanenbaum, Albert Woodhull
Question Posted:
Students also viewed these Computer science questions
-
In Sec. 4.8.4, it was pointed out that it would be better to search for holes for the text and data segments separately. Implement this improvement. Data from Sec. 4.8.4 The code for exec follows the...
-
On p. 43 it was pointed out that mass and energy are alternate aspects of a single entity called mass-energy. The relationship between these two physical quantities is Einstein's famous equation, E =...
-
It was pointed out that two advantages of using multiple threads within a process are that (1) less work is involved in creating a new thread within an existing process than in creating a new...
-
In seawater, the pressure p is related to the depth d according to 33p - 18d = 495 where d is in feet and p is in pounds per square inch. (a) Solve this equation for p in terms of d. (b) The Titanic...
-
Multiple Choice Questions 1. Lucas Foods has outstanding 600 shares of 7% preferred stock, $100 par value, and 1,600 shares of common stock , $30 par value. Lucas declares dividends of $15,800. The...
-
Barbara Marquardt is in charge of public relations for a cruise line that operates out of Miami. She is shocked to read a letter in a local newspaper from a disgruntled passenger, complaining about...
-
The mean square error criterion for ridge regression is \[ E\left(L_{1}^{2} ight)=\sum_{j=1}^{p} \frac{\lambda_{j}}{\left(\lambda_{j}+k ight)^{2}}+\sum_{j=1}^{p} \frac{\alpha_{j}^{2}...
-
Assume that Samsung manufactures and sells 60,000 units of a product at $11,000 per unit in domestic markets. It costs $6,000 per unit to manufacture ($4,000 variable cost per unit, $2,000 fixed cost...
-
You have a portfolio consisting solely of shares G and share W. The portfolio has an expected return of 13.64%. Share G has an expected return of 8.2% while share W is expected to return 16.2%. What...
-
In Fig. 4-9, the page field of the virtual address is 4 bits and the page field of the physical address is 3 bits. In general, is it permitted for the number of page bits of the virtual address to be...
-
A computer system has enough room to hold four programs in its main memory. These programs are each idle half the time waiting for I/O. What fraction of the CPU time is wasted?
-
Find at least six sources of advice on writing successful business plans (focus on start-up businesses that are likely to seek outside investors). Use at least two books, two magazine or journal...
-
Consider the demand for park visitation, Eq. (9.12b). a. We discussed (and illustrated in Figure 9.5) the effect of a change in \(q\) on demand for visits, \(v\). How would you expect the other...
-
Johnstone Inc. began operations in January 2014 and reported the following results for each of its 3 years of operations. Johnstone Inc. has never paid a cash or share dividend. There has been no...
-
Hakodat Manufacturing Company was organized January 1, 2015. During 2015, it has used in its reports to management the straight-line method of depreciating its plant assets. On November 8, you are...
-
Consider Arturo, an individual with utility for a composite good \((X)\) and indoor air quality \((Q): U=X Q\). Indoor air quality depends on pollution levels outside \((P)\) and defensive...
-
Go to the Pew Research Centers site and take the survey titled How do your views on gender compare with those of other Americans? found at...
-
Accounts are listed below for a foreign subsidiary that maintains its books in its local currency. The equity interest in the subsidiary was acquired in a purchase transaction. In the space provided,...
-
In a system with light damping (c < cc), the period of vibration is commonly defined as the time interval d = 2/d corresponding to two successive points where the displacement-time curve touches one...
-
When processor designers consider a possible improvement to the processor datapath, the decision usually depends on the cost/performance trade-off . In the following three problems, assume that we...
-
Problems in this exercise assume that logic blocks needed to implement a processors datapath have the following latencies: 1. If the only thing we need to do in a processor is fetch consecutive...
-
For the problems in this exercise, assume that there are no pipeline stalls and that the breakdown of executed instructions is as follows: 1. In what fraction of all cycles is the data memory used?...
-
The Canadian Superior Party Mix Company (CSPM) packages and sells three different 450 gram cans of mixed nuts. The three blends are called Plain Nuts, Mixed Nuts, and Premium Mix. A can of Plain Nuts...
-
1. Can you give examples of any successful OD programmes? Draw on recent research for your answer. 2. You have been asked to give a talk to a postgraduate management conference on The qualities...
-
Your boss e-mails you as follows: I keep on hearing about employee engagement but what does it really mean? Is it just another piece of HR jargon as an alternative to motivation? Is there anything we...
Study smarter with the SolutionInn App