Skip to contentSkip to conversation

Native skin: user space handles sharable between processes?

Xenomai-core Jan Kiszka 2 participants 5 messages Aug 25, 2008

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

Hi,

what is the policy for the user space handles the native skin generates:
Can the user share them between processes via putting them into shared memory (like it is allowed for some POSIX objects)?

I'm wondering if I have to use the POSIX pattern to resolve the address of a fast mutex: If shared, look to global heap, otherwise use process-local heap. If native handle structures were only valid within a single context, I could use absolute pointers instead, saving some code and data.

Thanks,
Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#1 lore raw
Quoted 9 lines · Jan Kiszka

Hi,

what is the policy for the user space handles the native skin generates:
Can the user share them between processes via putting them into shared memory (like it is allowed for some POSIX objects)?

I'm wondering if I have to use the POSIX pattern to resolve the address of a fast mutex: If shared, look to global heap, otherwise use process-local heap.

The posix skin does only this only the first time. If the address is local, it is computed and stored locally and never recomputed again.

Signature · 1 line
                                                 Gilles.
author
#2 lore raw
Quoted 7 lines · Gilles Chanteperdrix
Quoted 6 lines · Jan Kiszka

Hi,

what is the policy for the user space handles the native skin generates:
Can the user share them between processes via putting them into shared memory (like it is allowed for some POSIX objects)?

Quoted 6 lines
Quoted 3 lines

I'm wondering if I have to use the POSIX pattern to resolve the address of a fast mutex: If shared, look to global heap, otherwise use process-local heap.

The posix skin does only this only the first time. If the address is local, it is computed and stored locally and never recomputed again.

What remains is "if (shadow->attr.pshared) ...", so a condition + some bit in the shadow data structure.

I could merged that bit into the lowest bit of the lock pointer, OK, but would still have to check for it. If native defines that a handle is only valid within the process that obtained it, I could skip that dance altogether.

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
#3 lore raw
Quoted 14 lines · Jan Kiszka
Quoted 7 lines · Gilles Chanteperdrix
Quoted 6 lines · Jan Kiszka

Hi,

what is the policy for the user space handles the native skin generates:
Can the user share them between processes via putting them into shared memory (like it is allowed for some POSIX objects)?

Quoted 5 lines
Quoted 3 lines

I'm wondering if I have to use the POSIX pattern to resolve the address of a fast mutex: If shared, look to global heap, otherwise use process-local heap.

The posix skin does only this only the first time. If the address is local, it is computed and stored locally and never recomputed again.

Quoted 7 lines

What remains is "if (shadow->attr.pshared) ...", so a condition + some bit in the shadow data structure.

I could merged that bit into the lowest bit of the lock pointer, OK, but would still have to check for it. If native defines that a handle is only valid within the process that obtained it, I could skip that dance altogether.

Ok. I understand what you mean. I wanted to work this around for the POSIX API, but let us consider a real-life fact: the process-shared objects are a corner-case. So, let us not spend too much sweat on it.

Signature · 1 line
                                                 Gilles.
author
#4 lore raw
Quoted 17 lines · Gilles Chanteperdrix
Quoted 16 lines · Jan Kiszka
Quoted 7 lines · Gilles Chanteperdrix
Quoted 6 lines · Jan Kiszka

Hi,

what is the policy for the user space handles the native skin generates:
Can the user share them between processes via putting them into shared memory (like it is allowed for some POSIX objects)?

Quoted 5 lines
Quoted 3 lines

I'm wondering if I have to use the POSIX pattern to resolve the address of a fast mutex: If shared, look to global heap, otherwise use process-local heap.

The posix skin does only this only the first time. If the address is local, it is computed and stored locally and never recomputed again.

What remains is "if (shadow->attr.pshared) ...", so a condition + some bit in the shadow data structure.

Quoted 8 lines
Quoted 4 lines

I could merged that bit into the lowest bit of the lock pointer, OK, but would still have to check for it. If native defines that a handle is only valid within the process that obtained it, I could skip that dance altogether.

Ok. I understand what you mean. I wanted to work this around for the POSIX API, but let us consider a real-life fact: the process-shared objects are a corner-case. So, let us not spend too much sweat on it.

$CUSTOMER will like that, too: I'm going the easy way. :)

Jan

Signature · 2 lines
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux