what is the advantage of using SEMAPHORES to ORDINARY
VARIABLES???
Answers were Sorted based on User's Feedback
Answer / sachin dohre
Working of Semaphore is Atomic i.e till semaphore released
no change in shared memory could occur,, while in case of
variables it could be changed while context switching
| Is This Answer Correct ? | 4 Yes | 0 No |
Answer / test
semaphores helps is a varible which is used to protect the shared data .hence avoiding the coruption of data by the threads acting simultaniously..
| Is This Answer Correct ? | 7 Yes | 4 No |
If input is 123 then how to print 100 and 20 and 3 seperately?
Can you define which header file to include at compile time?
Can we use visual studio for c?
Q. where is the below variables stored ? - volatile, static, register
write a program to interchange the value between two variable without using loop
#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }
any function have arguments one or more OR not . it is compulsary a) any function compulsary have one or more arguments b) any function did not have arguments. It is not compulsary c) it is optional it is not compulsary d) none of the above
c program to manipulate x=1+3+5+...+n using recursion
Concat two string with most overlapped substring has to removeĀ "abcd"+ "cdef" = "abcdef
what is the basis for selection of arrays or pointers as data structure in a program
write a c prog for removing duplicate character from an array and sorting remaining elements using a single array
What is double pointer in c?