Who is faster, semaphore or share?

Started by dexter, November 19, 2013, 06:36:39 AM

Previous topic - Next topic

dexter

lets' just say there are 10 processes



I can use (share) to communicating between processes



But if process 1 (share something some value) ,other processes will get this update after a little time delayed,lets' just say it about 100us?( depends on computer)



so I am not sure about semaphore, is semaphore just the same thing as share? use the same way to do things?



or If I use semaphore , the communication between processes will faster than (share) ?

like Process 1 semaphored something value, other processed will get this update immediately??

Lutz

#1
share is used to access memory which can be shared between different processes. To avoid collision between processes accessing the shared memory area at the same time, semaphore can be used to avoid reading or writing while another process is reading or writing at the same time.