function A(int a[])
{
SemLock()
//Some Code....
SemUnlock()
}
Suppose some other thread has taken the same lock. Hence this function is blocked. Suppose this function is called by many other threads. All will be blocked. After Unlocking, will the data (parameter a[]) be lost or retained passed in as the parameter by different threads. How does this queuing of data takes place?
parameter
a[]is thread specific (non-shareable) so each thread has their own copy ofa[]. When a thread created a data-structure for thread is created.a[]is stored in thread’s stack.There is a queue of thread associated with each semaphore variable.
[ANSWER]
a[]will not loss.