Who is faster, semaphore or share?

Q&A's, tips, howto's
Locked
dexter
Posts: 74
Joined: Fri Nov 11, 2011 12:55 am

Who is faster, semaphore or share?

Post by 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
Posts: 5289
Joined: Thu Sep 26, 2002 4:45 pm
Location: Pasadena, California
Contact:

Re: Who is faster, semaphore or share?

Post by Lutz »

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.

Locked