*All the writers are trying to write at the same time....using ./writer & ./writer1 & ./writer2 using background process ....so there should be something ...like some variable...which is extern like used...accessed in all the files....& whose value is zero when one process is executing & in that time another clients will wait..in waiting queue...in pcb they will have waiting sign use ps -ax to see....so much less time....
*When one writer(client) has written its data...then this variable become 1 ...so it is said that semaphore is acquired by another process.....will make it zero again...& then executes...after executing made 1....said that semaphore is released...& then again made 1 means acquired by other writer..
*Semaphore is acquired & released ....the section of code b/w these two is called critical section...
*The diffrence b/w the normal extern variable used & semaphore is that....semaphore variable has atomicity.......atomicity means.....no another other writer will check to variable for writting & untill it is made 1....if it made 1 then variable is tested & used...in other writer.....
*The instant of time normal variable is making 1 to 0 ...it is tested as 1 & then other writer also starts writing ....when one writer is writting......is create a problem with normal variable....
*O MY GOD......semaphore is working awsum......either wriiten as ./writer & ./writer1 & ./writer2 ...
in background processes....it is able to write one by one......so in server....read all the clients...one by one............I LOVE IT......
*I have used extern or global variable....which is taking time to change its value sometmes...many times it is working perfectly.......but sometimes...reader reads immidately before 2nd or 3rd writer writes...bcz it is taking time to handle global variable........