Question

In: Computer Science

8a) In Windows system programming, many system resources are represented as kernel objects, each of which...

8a) In Windows system programming, many system resources are represented as kernel objects, each of which is represented as a handle. Discuss with 3 examples how the system programmer can manipulate these handle objects. AP, 8
b) Write a C/C++ system program to move a file from one folder to another in the Windows file system. Compile and run the program and copy the source code into your answer booklet. CR,10
c) Compare and contrast processes and threads and discuss how threads are scheduled. AN, 7

Solutions

Expert Solution

Ans C:

Difference b/w Processes and Threds are:

Processes:

1) A process is a program under execution i.e an active program.

2) Processes require more time for context switching as they are more heavy.

3) Processes are totally independent and don’t share memory.

4) Communication between processes requires more time than between threads.

5) If a process gets blocked, remaining processes can continue execution.

6) Processes require more resources than threads.

7) Individual processes are independent of each other.

Threads:

1) A thread is a lightweight process that can be managed independently by a scheduler.

2) Threads require less time for context switching as they are lighter than processes.

3) A thread may share some memory with its peer threads.

4) Communication between threads requires less time than between processes .

5) If a user level thread gets blocked, all of its peer threads also get blocked.

6) Threads generally need less resources than processes.

7) Threads are parts of a process and so are dependent.

How Threads are scheduled

Threads are scheduled for execution depending on their priority. Even though threads are executing inside the runtime, all threads are allocated processor time slices by the operating system. For each operating system, the specifics of the scheduling algorithm used to decide the order in which threads are executed differ.

Ans B

Program to move a file from one folder to another .

#include<iostream>
#include <bits/stdc++.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
using namespace std;
int main()
{
  
char src[50],dest[50],cmd[100];
cout<<"\nENTER FULL PATH OF FILE TO BE MOVED : ";
gets(src);
cout<<"ENTER FULL PATH WHERE FILE IS TO BE MOVED : ";
gets(dest);
strcpy(cmd,"mv ");
strcat(cmd,src);
strcat(cmd," ");
strcat(cmd,dest);
system(cmd);
return 0;
}


Related Solutions

In Windows system programming, many system resources are represented as kernel objects, each of which is...
In Windows system programming, many system resources are represented as kernel objects, each of which is represented as a handle. Discuss with 3 examples how the system programmer can manipulate these handle objects.
Explain what classes and objects are in object - oriented programming. Give an example of each...
Explain what classes and objects are in object - oriented programming. Give an example of each and explain how they work together in a computer program.
Identify the most important resources and capabilities represented in a=Apple's global supply chain (considered my many...
Identify the most important resources and capabilities represented in a=Apple's global supply chain (considered my many to be the best in the world), using the VRIO approach. Additionally, What do you think are some of the key global issues and options Apple faces going forward (from 2020)?
How many members to an IRB? and what are each position that should be represented on...
How many members to an IRB? and what are each position that should be represented on the IRB?
Consider a system consisting of 4 resources of the same type that are shared among 3 processes, each of which needs at most 2 resources.
Consider a system consisting of 4 resources of the same type that are shared among 3 processes, each of which needs at most 2 resources. Show that the system is deadlock-free. Hint: Show that the condition ((claim-allocated) <= available) can always be satisfied.
5. Microsoft Corporation decides how many packets of the new operating system (Windows Vista) it is...
5. Microsoft Corporation decides how many packets of the new operating system (Windows Vista) it is going to sell on the market. The research (fixed) costs associated with the development of the new system amounts to F = $1000. The variable costs of the packet is negligible C(y) = 0. Microsoft’s inverse demand for the new operating system is given by P (y) = 100 − y. • Assume that Microsoft cannot discriminate among its customers. Find geometrically and analytically...
Programming Challenge #10. C++ Early Objects 10ed. A talent competition has five judges, each of whom...
Programming Challenge #10. C++ Early Objects 10ed. A talent competition has five judges, each of whom awards a score between 0 and 10 to each performer. Fractional scores, such as 8.3, are allowed. A performer's final score is determined by dropping the highest and lowest score received, then averaging #include <iostream> #include <iomanip> using namespace std; // Function prototypes double getJudgeData(); double calcScore(double, double, double, double, double); double findLowest(double, double, double, double, double); double findHighest(double, double, double, double, double); int...
2. If each of the following objects are rotating with the same angular velocity, ?, which...
2. If each of the following objects are rotating with the same angular velocity, ?, which would be the hardest to stop? (i.e., require the largest amount of work). A hoop with mass (1/2)M and radius 2R rotating about its cylinder axis. A solid cylinder with mass 4M and radius (3/4)R rotating about its cylinder axis. A solid sphere with mass 8M and radius (2/3)R rotating about any diameter. A hoop with mass 4M and radius (1/2)R rotating about its...
Which of the following two windows would insulate better, and by how many times lower would...
Which of the following two windows would insulate better, and by how many times lower would the rate of thermal conduction through it be compared to the other? Take both to be airtight and ignore radiative losses. Each window has a total size of 1.2 m high by 0.6 m wide, with the outer 2 cm edge of each window being the frame. For simplicity, take the frames to have the same thickness as the pane (of course for a...
In main, create two FracList objects, ask the user how many elements to allocate for each...
In main, create two FracList objects, ask the user how many elements to allocate for each list, read as many Fraction objects from the keyboard as specified by the user into each (using >> operator). Sort both lists using the sort member function and display them; and then search for a value read from the user in both lists and print the index of the first occurrence or that it could not be found in either list. Swap the two...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT