Question
Can multiple processes be in waiting state on the same device at the same time? How does operating system keep track of processes in the
Can multiple processes be in waiting state on the same device at the same time? How does operating system keep track of processes in the waiting state?
When would you prefer to use shared memory over message passing IPC scheme?
draw the memory layout of all the process created by the following program when the process is at LINE A. Explicitly show all the memory regions (text, data, stack and heap) for each process and display the variables and their respective values as stored in each region.
Also, what will be printed by this program on the screen?
#include #include #include
int SIZE = 4; int k=10;
void printIt(int *m) { int i=0; for (i=0; i printf("%d,",m[i]); } printf(" "); // LINE A } void increment(int* a, int divider) { int i=0; for (i=0; i if (a[i]%divider==0) { a[i]++; } } printIt(a); } void compute(int p) { int* c = (int *)malloc(sizeof(int)*SIZE); c[0]=10; c[1]=12; c[2]=11; c[3]=18; increment(c, p); } void main() { compute(3); } |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started