On Tue, Mar 26, 2013 at 09:11, Martijn van Duren wrote:

> To prevent producing clutter by multiple processes/threads writing to
> the same socket at the same time, due to race conditions, I was thinking
> about using semaphores, but I saw that named semaphores aren't
> supported.
> 
> When looking through the source I noticed that there's hardly any
> semaphore use inside the OpenBSD code. So I was wondering what the
> preferred way of handling this kind of issues is on OpenBSD.

Some combination of pthread_mutex_lock, pthread_cond_wait, or sem_wait
is probably what you want for threaded apps. If it's multi process,
there's always sysv semaphores, see semop and semctl.

  • semaphores Martijn van Duren
    • Re: semaphores Ted Unangst

Reply via email to