Native skin: user space handles sharable between processes?
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
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.
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
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.
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