Re: semaphores between processes

2009-10-23 Thread John Baldwin
On Thursday 22 October 2009 5:17:07 pm Daniel Eischen wrote: On Thu, 22 Oct 2009, Andrew Gallatin wrote: Daniel Eischen wrote: On Thu, 22 Oct 2009, Andrew Gallatin wrote: Hi, We're designing some software which has to lock access to shared memory pages between several processes,

Re: semaphores between processes

2009-10-23 Thread Daniel Eischen
On Fri, 23 Oct 2009, John Baldwin wrote: On Thursday 22 October 2009 5:17:07 pm Daniel Eischen wrote: On Thu, 22 Oct 2009, Andrew Gallatin wrote: Daniel Eischen wrote: On Thu, 22 Oct 2009, Andrew Gallatin wrote: Hi, We're designing some software which has to lock access to shared memory

Re: semaphores between processes

2009-10-23 Thread Andrew Gallatin
Daniel Eischen wrote: On Fri, 23 Oct 2009, John Baldwin wrote: On Thursday 22 October 2009 5:17:07 pm Daniel Eischen wrote: On Thu, 22 Oct 2009, Andrew Gallatin wrote: Daniel Eischen wrote: On Thu, 22 Oct 2009, Andrew Gallatin wrote: Hi, We're designing some software which has to lock

Re: semaphores between processes

2009-10-23 Thread John Baldwin
On Friday 23 October 2009 10:56:06 am Daniel Eischen wrote: On Fri, 23 Oct 2009, John Baldwin wrote: On Thursday 22 October 2009 5:17:07 pm Daniel Eischen wrote: On Thu, 22 Oct 2009, Andrew Gallatin wrote: Daniel Eischen wrote: On Thu, 22 Oct 2009, Andrew Gallatin wrote: Hi,

Re: semaphores between processes

2009-10-23 Thread Daniel Eischen
On Fri, 23 Oct 2009, Andrew Gallatin wrote: Daniel Eischen wrote: On Fri, 23 Oct 2009, John Baldwin wrote: On Thursday 22 October 2009 5:17:07 pm Daniel Eischen wrote: On Thu, 22 Oct 2009, Andrew Gallatin wrote: Daniel Eischen wrote: On Thu, 22 Oct 2009, Andrew Gallatin wrote: Hi,

Re: semaphores between processes

2009-10-23 Thread Andrew Gallatin
Daniel Eischen wrote: On Fri, 23 Oct 2009, Andrew Gallatin wrote: Daniel Eischen wrote: On Fri, 23 Oct 2009, John Baldwin wrote: On Thursday 22 October 2009 5:17:07 pm Daniel Eischen wrote: On Thu, 22 Oct 2009, Andrew Gallatin wrote: Daniel Eischen wrote: On Thu, 22 Oct 2009, Andrew

Re: semaphores between processes

2009-10-23 Thread Daniel Eischen
On Fri, 23 Oct 2009, Andrew Gallatin wrote: Daniel Eischen wrote: On Fri, 23 Oct 2009, Andrew Gallatin wrote: It would be great if they were, but that discussion was 6 months ago, and nothing seems to have happened. Plus we need to support at least 7.X and probably 6, so any changes here

Re: semaphores between processes

2009-10-23 Thread Andrew Gallatin
Daniel Eischen wrote: We already use umtx. This really is a hack and I wouldn't advocate it. I'm not sure how you could make it work and not break existing ability to return appropriate error codes without slowing down the path in the non-shared case. You'd have to check to see if the

Re: semaphores between processes

2009-10-23 Thread Daniel Eischen
On Fri, 23 Oct 2009, Andrew Gallatin wrote: Daniel Eischen wrote: We already use umtx. This really is a hack and I wouldn't advocate it. I'm not sure how you could make it work and not break existing ability to return appropriate error codes without slowing down the path in the non-shared

semaphores between processes

2009-10-22 Thread Andrew Gallatin
Hi, We're designing some software which has to lock access to shared memory pages between several processes, and has to run on Linux, Solaris, and FreeBSD. We were planning to have the lock be a pthread_mutex_t residing in the shared memory page. This works well on Linux and Solaris, but

Re: semaphores between processes

2009-10-22 Thread Andrew Gallatin
Daniel Eischen wrote: On Thu, 22 Oct 2009, Andrew Gallatin wrote: Hi, We're designing some software which has to lock access to shared memory pages between several processes, and has to run on Linux, Solaris, and FreeBSD. We were planning to have the lock be a pthread_mutex_t residing in the

Re: semaphores between processes

2009-10-22 Thread Daniel Eischen
On Thu, 22 Oct 2009, Andrew Gallatin wrote: Hi, We're designing some software which has to lock access to shared memory pages between several processes, and has to run on Linux, Solaris, and FreeBSD. We were planning to have the lock be a pthread_mutex_t residing in the shared memory page.

Re: semaphores between processes

2009-10-22 Thread Daniel Eischen
On Thu, 22 Oct 2009, Andrew Gallatin wrote: Daniel Eischen wrote: On Thu, 22 Oct 2009, Andrew Gallatin wrote: Hi, We're designing some software which has to lock access to shared memory pages between several processes, and has to run on Linux, Solaris, and FreeBSD. We were planning to have

Re: semaphores between processes

2009-10-22 Thread Vlad Galu
On Thu, Oct 22, 2009 at 11:08 PM, Andrew Gallatin galla...@cs.duke.edu wrote: Hi, We're designing some software which has to lock access to shared memory pages between several processes, and has to run on Linux, Solaris, and FreeBSD.  We were planning to have the lock be a pthread_mutex_t

Re: semaphores between processes

2009-10-22 Thread Jilles Tjoelker
On Thu, Oct 22, 2009 at 04:08:11PM -0400, Andrew Gallatin wrote: We then moved on to posix semaphores. Using sem_wait/sem_post with the sem_t residing in a shared page seems to work on all 3 platforms. However, the FreeBSD (7-stable) man page for sem_init(3) has this scary text regarding the