Semaphores on QNX Neutrino

Hi everyone,

Does QNX Neutrino 2.x support System V semaphore?
I need to use a process-shared mutex, does the POSIX
semaphore support sharing a mutex across different processes?

Thanks.


Sent via Deja.com http://www.deja.com/
Before you buy.

cateyes5612@my-deja.com wrote:

Hi everyone,

Does QNX Neutrino 2.x support System V semaphore?

No, but it supports POSIX semaphores

I need to use a process-shared mutex, does the POSIX
semaphore support sharing a mutex across different processes?

you can use either mutex or POSIX semaphore - both can be shared in
Neutrino.

Thanks.

Sent via Deja.com > http://www.deja.com/
Before you buy.

cateyes5612@my-deja.com wrote:


Hi everyone,

Does QNX Neutrino 2.x support System V semaphore?
I need to use a process-shared mutex, does the POSIX
semaphore support sharing a mutex across different processes?

No, it supports Posix semaphores, either named (slow, through mqueue)
or anonymous (fast, through shared memory).

Also, mutexes and condition variables can be shared between processes –
they must be in memory visible to both process (shared memory) and
the must have the pshared flag set – pthread_mutexattr_setpshared()
before creation. (I think doing mutexes between processes rather than
just threads is an extension to Posix.)

-David

In article <8t9ii2$p1g$2@nntp.qnx.com>, David Gibbs <dagibbs@qnx.com> wrote:

cateyes5612@my-deja.com > wrote:


Hi everyone,

Does QNX Neutrino 2.x support System V semaphore?
I need to use a process-shared mutex, does the POSIX
semaphore support sharing a mutex across different processes?

No, it supports Posix semaphores, either named (slow, through mqueue)
or anonymous (fast, through shared memory).

Also, mutexes and condition variables can be shared between processes –
they must be in memory visible to both process (shared memory) and
the must have the pshared flag set – pthread_mutexattr_setpshared()
before creation. (I think doing mutexes between processes rather than
just threads is an extension to Posix.)

Sigh. Just look it up. Shared process mutexes aren’t an extension,
but they are optional with a feature test comparison (macro definition).

Steve Furr email: furr@qnx.com
QNX Software Systems, Ltd.

Steve Furr wrote:

In article <8t9ii2$p1g$> 2@nntp.qnx.com> >, David Gibbs <> dagibbs@qnx.com> > wrote:
cateyes5612@my-deja.com > wrote:


Hi everyone,

Does QNX Neutrino 2.x support System V semaphore?
I need to use a process-shared mutex, does the POSIX
semaphore support sharing a mutex across different processes?

No, it supports Posix semaphores, either named (slow, through mqueue)
or anonymous (fast, through shared memory).

Also, mutexes and condition variables can be shared between processes –
they must be in memory visible to both process (shared memory) and
the must have the pshared flag set – pthread_mutexattr_setpshared()
before creation. (I think doing mutexes between processes rather than
just threads is an extension to Posix.)

Sigh. Just look it up. Shared process mutexes aren’t an extension,
but they are optional with a feature test comparison (macro definition).

Also, I believe pthreas_mutexattr_setpshared() returns ENOSYS but it
seems to be always ‘on’.

  • igor