edited
1,200 views
0 votes
0 votes
i have one doubt ...we know that ready , running and block waiting are lies inside main memory but it saying that when the process are in running state then process are suppose to given to CPU so when we have done with given of process to CPU how we can say that the process are in RAM or Running state are in RAM...please reply it is actually funny question .
edited

2 Answers

0 votes
0 votes
When the process completes its work, the memory is deallocated.

If process moves from running to ready or waiting, the process will be in memory since the CPU will require to complete the rest of the work
0 votes
0 votes

A process is a data structure that an OS requires to execute  a program. For a given program, we create a process in the main memory. A process consists of Data Section (consisting of global and static variables), Code / Text Section (which contains executable machine code), Heap and Stack (to support dynamic memory allocation and function calls).

So when the scheduler schedules a process, the OS takes that process's context (PCB) and puts it in RUNNING queue, just to keep track of the what process's are running.

When we say "a process is running or CPU is executing a process"

                                               

                                                     or in your words

              process is given to the CPU

, what we mean is that the CPU is taking executable machine code from that process's (which is living inside the main memory) text / code section and executing it line by line.

Related questions

1 votes
1 votes
1 answer
1
iarnav asked Apr 11, 2017
1,824 views
Hello, please kindly list out the topics which are needed to be studied from topic file system?!You can also pinpoint the topics from Galvin book 7th edition.
0 votes
0 votes
1 answer
2
iarnav asked Jul 17, 2018
812 views
Let's say we have four processes as (P1, P2, P3, P4) and have Arrival time as (0,1,2,3) respectively, but all of them has same CPU Burst time as (10ms) then does SRTF wil...
0 votes
0 votes
0 answers
3
ejaz asked Jun 7, 2018
188 views
https://gateoverflow.in/1750/gate2012-32Will it suffer into deadlock( It is already explained by srestha user but still I didn't understand her point of view aswhat if P...
1 votes
1 votes
2 answers
4
Shaik Masthan asked Jun 4, 2018
878 views
#include <stdio.h int main(void) { int i=0; printf("HAI\n"); for(i=1;i<=3;i++) { if(fork()==0) printf("*"); } return 0; } How many times * will be printed? and How many t...