newLISP Fan Club

Forum => newLISP in the real world => Topic started by: dexter on November 19, 2013, 06:36:39 AM

Title: Who is faster, semaphore or share?
Post by: dexter on November 19, 2013, 06:36:39 AM
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??
Title: Re: Who is faster, semaphore or share?
Post by: Lutz on November 19, 2013, 08:50:39 AM
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.