I am confused with what exactly Starvation mean ?
AFAIK Considering Process Scheduling eg SRTF and SJF , Starvation can be considered when some process is getting preempted by other high priority processes and hence not getting a chance to execute on CPU and hence is said to be "starving".
But, Considering Synchronization eg TEST_AND_SET Lock ,
(1) TSL Ri,m[flag]
(2)CMP Ri,0
(3) JNZ to (1)
(4) **CS**
(5) Store m[flag],0
here also we say that starvation is there in the sense that ,
Suppose, Process P1 comes executes (1) to (3) and enters CS
Now, Processes P2,P3,P4,P5 comes and since flag=1 they loop in statements (1) to (3),
Now , P1 comes out of CS and sets flag=0, Now, Out of P2,P3,P4,P5 any one can go into CS first .
If the same scenario continues we could say any of P2,P3,P4,P5 may starve in the sense they never get access to CS but they obviously are executing on CPU.
Here, my confusion lies,
Starvation is w.r.t to getting executing on CPU or getting access to CS ?
PS: I have one more doubt , in synchronization ques , while solving do we consider a Single processor system or a Multiprocessor i.e. when we have multiple processing cores or CPUs available?