Checkout
checkout
view
Your Cart Your Cart: item(s)
Subjects -> Computer Science -> Operating Systems -> Posting #129513
Add to Shopping Cart
$2.19 Instant Download
Computer Science, Operating Systems
Year 3

Running Code


5. What happens when you run the following piece of code:

main(int argc, char ** argv)
{
for(;;)
    fork();
}
Given the following piece of code:
main(int argc, char ** argv)
{
int child = fork();
int c = 5;
if(child == 0)
{
c += 5;
}
else
{
child = fork();
c += 10;
if(child)
c += 5;
}
}

How many different copies of the variable c are there? What are their values?
  
Given the following piece of code
main(int argc, char ** argv)
{
forkthem(5)
}
void forkthem(int n)
{
if(n > 0)
{
fork();
forkthem(n-1);
}
}
How many processes are created if the above piece of code is run?
Most round-robin schedulers use a fixed size quantum. Give an argument in favor of and against a small quantum.

Attachments
RUNNING CODE.doc  View File

By OTA:  Sandeep Kumar, MTech

OTA Rating:  4.8/5

Your Price:  $2.19  (original value ~$15.96)

What's included:

  • Plain text response
$2.19 Download Add to Cart

Add to Shopping Cart
$2.19 Instant Download
work and energy - 1. You have a 16 oz cup of coffee at 180 degrees F. That is way too hot to drink. So you want to cool the coffee off and decide to add some cold water. You add 2 ounces of cold water at 40 degrees F. How much will the water you added heat up? How much will the coffee that you poured the water into cool down? 2. An air bubble at the bottom of a lake has a volume...
Displacement, Velocity, Acceleration, Newton's Laws, Work, Energy, Momentum, Fluid Mechanics, Heat and Thermodynamics - 1) A person paddling a canoe travels five miles down a canal and then seven miles up the canal. a) How far did the person travel? b) What is his final displacement? 2) A test vehicle on a track goes through photo gates spaced 25 m a...
Sound - 1) Sound waves travel through an aluminum bar at a speed of 1400 m/s. If the frequency of the sound wave is 880 Hz, what is the distance between crests on a sound wave traveling through aluminum? 2) An airplane flies horizontally at a constant speed, piloted by rescuers who are searching for a disabled boat. When the plane is directly above the boat, the boat's ...
Electromagnetic Waves and Maxwell's Equations - 1. Explain how the wave equation arises out of Maxwell's Equations. Relate your discussion to the following simulation of an electromagnetic wave: Electromagnetic wave 2. Explain the effect of the speed of light on electromagnetic waves. 3. Explain how you could find the frequency of an electromagnetic w...
The Physics of Electronic Devices and Circuits - Please address: 1. How electrons move in conductors, semiconductors, and insulators 2. How diodes and simple transistors are constructed and how they work

Page generated in 0.016 seconds

About Us ·  Contact Us ·  Samples ·  Solutions ·  Legal Terms and Conditions ·  Privacy Policy

©2008 SolutionLibrary.com

Search for Solutions About Us Samples