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 c

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 addres

Re: semaphores between processes

2009-10-23 Thread Daniel Eischen
either: 1) use sysv semaphores (ick) 2) use a hand rolled spinlock (ick) 3) use some sort of hack built into our driver (ick, ick) 4) use umtx Is there some bug or limitation in umtx that makes it inappropriate? (beyond the obvious, like the potential to leave a resource locked forever if the lock ho

Re: semaphores between processes

2009-10-23 Thread Andrew Gallatin
x and Solaris, but FreeBSD (at least 7-stable) does not support PTHREAD_PROCESS_SHARED mutexes. 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

Re: semaphores between processes

2009-10-23 Thread Daniel Eischen
D (at least 7-stable) does not support PTHREAD_PROCESS_SHARED mutexes. 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 ps

Re: semaphores between processes

2009-10-23 Thread John Baldwin
ral 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 FreeBSD

Re: semaphores between processes

2009-10-23 Thread Andrew Gallatin
pport PTHREAD_PROCESS_SHARED mutexes. 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 pshared value: The sem_init() fun

Re: semaphores between processes

2009-10-23 Thread Daniel Eischen
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 pshared value: The sem_init() function initializes the unnamed sema

Re: semaphores between processes

2009-10-23 Thread John Baldwin
;> shared memory page. This works well on Linux and Solaris, > >>> but FreeBSD (at least 7-stable) does not support > >>> PTHREAD_PROCESS_SHARED mutexes. > >>> > >>> We then moved on to posix semaphores. Using sem_wait/sem_post > >>> with the sem_t resi

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 te

Re: semaphores between processes

2009-10-22 Thread Vlad Galu
mutex_t residing in the > shared memory page.  This works well on Linux and Solaris, > but FreeBSD (at least 7-stable) does not support > PTHREAD_PROCESS_SHARED mutexes. > > We then moved on to posix semaphores.  Using sem_wait/sem_post > with the sem_t residing in a shared page see

Re: semaphores between processes

2009-10-22 Thread Daniel Eischen
have the lock be a pthread_mutex_t residing in the shared memory page. This works well on Linux and Solaris, but FreeBSD (at least 7-stable) does not support PTHREAD_PROCESS_SHARED mutexes. We then moved on to posix semaphores. Using sem_wait/sem_post with the sem_t residing in a shared page see

Re: semaphores between processes

2009-10-22 Thread Daniel Eischen
page. This works well on Linux and Solaris, but FreeBSD (at least 7-stable) does not support PTHREAD_PROCESS_SHARED mutexes. 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

Re: semaphores between processes

2009-10-22 Thread Andrew Gallatin
n the shared memory page. This works well on Linux and Solaris, but FreeBSD (at least 7-stable) does not support PTHREAD_PROCESS_SHARED mutexes. 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

semaphores between processes

2009-10-22 Thread Andrew Gallatin
, but FreeBSD (at least 7-stable) does not support PTHREAD_PROCESS_SHARED mutexes. 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 rega

posix semaphores

2008-05-06 Thread Mark Bucciarelli
How reliable is the Posix semaphore support in FreeBSD 7 for interprocess synchronization? Is it not on by default because no one uses it, or because the code isn't trustworthy, or some other reason? Is this what you would recommend for synchronizing access to a shared resource between processes

Re: Semaphores

2008-01-04 Thread Ivan Voras
On 04/01/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Quoting Ivan Voras <[EMAIL PROTECTED]>: > > > For general information on the FreeBSD kernel see the book "Design and > > implementation of the FreeBSD operating system", > > Will this edition be updated, or is it still relevant with the

Re: Semaphores

2008-01-04 Thread gregoryd . freebsd
Quoting Ivan Voras <[EMAIL PROTECTED]>: > For general information on the FreeBSD kernel see the book "Design and > implementation of the FreeBSD operating system", Will this edition be updated, or is it still relevant with the coming of 7.0 ? It was written with 5.0 in mind, and considerable prog

Re: Semaphores

2008-01-03 Thread Julian Elischer
Neeku Shamekhi wrote: I need some article about semaphores in freeBSD and mainly about kern_sema.c file. man 9 sema ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any

Re: Semaphores

2008-01-03 Thread Ivan Voras
Neeku Shamekhi wrote: > I need some article about semaphores in freeBSD and mainly about kern_sema.c > file. About the best documentation you will find is this: http://fxr.watson.org/fxr/source/kern/kern_sema.c For general information on the FreeBSD kernel see the book "Design and imp

Semaphores

2008-01-03 Thread Neeku Shamekhi
I need some article about semaphores in freeBSD and mainly about kern_sema.c file. ___ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Value range of IPC semaphores

2006-11-10 Thread Nguyen Tam Chinh
Hello, I'm tuning some IPC semaphores parameters in 6.1-STABLE for a busy PostGreSQL server (8.1.4). I still now can not find the value range (exactly the maximum value) and its dependencies on other system wide parameters of these parameters: kern.ipc.semmni, kern.ipc.s

Re: Fixing Posix semaphores

2004-12-22 Thread Kamal R. Prasad
--- Peter Pentchev <[EMAIL PROTECTED]> wrote: > On Wed, Dec 22, 2004 at 12:01:51AM +, Robert > Watson wrote: > > > > On Mon, 13 Dec 2004, Joe Kelsey wrote: > > > > > I have a desire to fix posix semaphores in at > least 5.3. The current > &

Re: Fixing Posix semaphores

2004-12-21 Thread Peter Pentchev
On Wed, Dec 22, 2004 at 12:01:51AM +, Robert Watson wrote: > > On Mon, 13 Dec 2004, Joe Kelsey wrote: > > > I have a desire to fix posix semaphores in at least 5.3. The current > > implementation doesn't actually follow the "spirit" of the standard, >

Re: Fixing Posix semaphores

2004-12-21 Thread Robert Watson
On Mon, 13 Dec 2004, Joe Kelsey wrote: > I have a desire to fix posix semaphores in at least 5.3. The current > implementation doesn't actually follow the "spirit" of the standard, > even though it technically qualifies in a somewhat degraded sense. I > refer t

Re: Fixing Posix semaphores

2004-12-15 Thread Julian Elischer
ystem. Read-only versus other options have absolutely no bearing on this problem. Unnamed posix semaphores work just fine in this case. I have built lots of FreeBSD systems on flash with no problems. This "fantasy" of a problem has no bearing on the issue I want to discuss. I woul

Re: Fixing Posix semaphores

2004-12-15 Thread Joe Kelsey
On Tue, 2004-12-14 at 08:08 -0800, Kamal R. Prasad wrote: > --- Joe Kelsey <[EMAIL PROTECTED]> wrote: > > > I have a desire to fix posix semaphores in at least > > 5.3. The current > > implementation doesn't actually follow the "spirit" > &

Re: Fixing Posix semaphores

2004-12-15 Thread Joe Kelsey
do use netbsd that way. For the most part, you > wouldn't want to create a file on such a system. Read-only versus other options have absolutely no bearing on this problem. Unnamed posix semaphores work just fine in this case. I have built lots of FreeBSD systems on flash with no problems. Th

Re: Fixing Posix semaphores

2004-12-14 Thread Kamal R. Prasad
--- Joe Kelsey <[EMAIL PROTECTED]> wrote: > On Tue, 2004-12-14 at 08:08 -0800, Kamal R. Prasad > wrote: > > --- Joe Kelsey <[EMAIL PROTECTED]> wrote: > > > > > I have a desire to fix posix semaphores in at > least > > > 5.3. The curre

Re: Fixing Posix semaphores

2004-12-13 Thread Kamal R. Prasad
--- Joe Kelsey <[EMAIL PROTECTED]> wrote: > I have a desire to fix posix semaphores in at least > 5.3. The current > implementation doesn't actually follow the "spirit" > of the standard, > even though it technically qualifies in a somewhat > degraded

Fixing Posix semaphores

2004-12-13 Thread Joe Kelsey
I have a desire to fix posix semaphores in at least 5.3. The current implementation doesn't actually follow the "spirit" of the standard, even though it technically qualifies in a somewhat degraded sense. I refer to the fact that the current implementation treats posix semaphore

Re: pthreads, semaphores and wait

2000-11-30 Thread Daniel M. Eischen
"Dimitar V. Peikov" wrote: > > I've tryed to make some example on using pthreads and semaphores and found > that process became blocked if inside of critical section use wait, uwait or > nanowait finctions. In the attached file if change line : (#if 0) to (#if 1) >

pthreads, semaphores and wait

2000-11-30 Thread Dimitar V. Peikov
I've tryed to make some example on using pthreads and semaphores and found that process became blocked if inside of critical section use wait, uwait or nanowait finctions. In the attached file if change line : (#if 0) to (#if 1) the program hangs. I've tested it even with gdb and t

Re: semaphores inside kernel???

2000-09-21 Thread Greg Lehey
udo-devicer, many instaces of this device may > be active, all have to share a resource. all instances have to > synchronize their access to the resource. trying to implement this, > i ended up with a less powerful version of semaphores. since the > resultant code became little complex,

RE: semaphores inside kernel???

2000-09-18 Thread John Baldwin
p with a > less powerful version of semaphores. since the > resultant code became > little complex, i want to replace that with the more > generic semaphores. > > i checked the include files, but i couldn't find any > semaphore > functions(semget,semctl,semop) which are

semaphores inside kernel???

2000-09-18 Thread Mohan Krishna P
hi, i am implementing a pseudo-devicer, many instaces of this device may be active, all have to share a resource. all instances have to synchronize their access to the resource. trying to implement this, i ended up with a less powerful version of semaphores. since the resultant code became

Re: Tuning up semaphores in kernel

2000-02-20 Thread Juergen Lock
In article <[EMAIL PROTECTED]> you write: >On Sun, 13 Feb 19100, Andrey Novikov wrote: > >> > You probably want to increase either SEMMNI or SEMMNS. >> >> I've noticed that but why are they so "round"? Is there any corelation >> between all these numbers? I don't want to break my kernel by guessi

Re: Tuning up semaphores in kernel

2000-02-20 Thread BARRY BOUWSMA IS A MASSMURDERER
On Sun, 13 Feb 19100, Andrey Novikov wrote: > > You probably want to increase either SEMMNI or SEMMNS. > > I've noticed that but why are they so "round"? Is there any corelation > between all these numbers? I don't want to break my kernel by guessing. > > > > options SEMMAP=31 > > > opt

Re: Tuning up semaphores in kernel

2000-02-13 Thread Brian Dean
SEMMNI is the number of semaphore ids, i.e., the number of times you can call 'semget()' without deleting any semaphores. SEMMNS is the actual number of semaphores in the system, which should be >= SEMMNI. Of course, you can ask 'semget()' to give you up to SEMMSL sema

Re: Tuning up semaphores in kernel

2000-02-13 Thread Andrey Novikov
> struct seminfo seminfo = { > SEMMAP, /* # of entries in semaphore map */ > SEMMNI, /* # of semaphore identifiers */ > SEMMNS, /* # of semaphores in system */ > SEMMNU, /* # of und

Re: Tuning up semaphores in kernel

2000-02-11 Thread Brian Dean
Take a look at: sys/conf/param.c: /* * Values in support of System V compatible semaphores. */ #ifdef SYSVSEM struct seminfo seminfo = { SEMMAP, /* # of entries in semaphore map */ SEMMNI, /* # of semaphore identifiers

Tuning up semaphores in kernel

2000-02-11 Thread Andrey Novikov
Hello. Resently my PostgreSQL daemon died with: IpcSemaphoreCreate: semget failed (No space left on device) key=5432015, num=16, permission=600 I figured out that the kernel is out of available semaphores, I wanted to rebuild it but the problem is that the options related to semaphores are not

Re: semaphores/semget problem

1999-11-01 Thread Peter Jeremy
Kent Boortz <[EMAIL PROTECTED]> wrote: > semget(IPC_PRIVATE, SEMMSL, IPC_EXCL | IPC_CREAT | 0600)) > > fails with the error "No space left on device". Since SEMMSL defaults to SEMMNS, this is guaranteed to fail if anything else is using semaphores. > I tried

Re: semaphores/semget problem

1999-10-31 Thread J Wunsch
ot; defaults to 60, that's the maximal number of semaphores allowed in the system (accumulated over all calls to semget() that are active by the same time). Also, due to the crocky^H^H^H^H^H^Hfunny concept of SysV IPC, you might as well run out of semaphore IDs instead (== #calls to semge

semaphores/semget problem

1999-10-30 Thread Kent Boortz
I tried to port the Linux sound program GramoFile but failed. The source was found at http://cardit.et.tudelft.nl/~card06/ It was easy to make it compile and link, mostly changing to , and -lcurses to -lncurses. But creating the System V semaphores fails when trying to play some sound. A