If the two processes are not related to each other, you should use a named semaphore. If two processes are connected (i.e. Forked), or if you just use a semaphore between threads, you should use unnamed.
The benefits of the unnamed are that you do not need to keep track of names and any permissions or disable them. And unnamed semaphores can be used as a simple global variable (or on the heap) in the case when they are distributed between threads of the same process, or placed in shared memory, which will be inherited by children in the case of a bifurcated process.
source share