* [Xenomai-core] Native skin: user space handles sharable between processes?
@ 2008-08-25 11:36 Jan Kiszka
2008-08-25 12:08 ` Gilles Chanteperdrix
0 siblings, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2008-08-25 11:36 UTC (permalink / raw)
To: xenomai-core
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
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-core] Native skin: user space handles sharable between processes?
2008-08-25 11:36 [Xenomai-core] Native skin: user space handles sharable between processes? Jan Kiszka
@ 2008-08-25 12:08 ` Gilles Chanteperdrix
2008-08-25 12:16 ` Jan Kiszka
0 siblings, 1 reply; 5+ messages in thread
From: Gilles Chanteperdrix @ 2008-08-25 12:08 UTC (permalink / raw)
To: Jan Kiszka; +Cc: xenomai-core
Jan Kiszka wrote:
> 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.
--
Gilles.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Xenomai-core] Native skin: user space handles sharable between processes?
2008-08-25 12:08 ` Gilles Chanteperdrix
@ 2008-08-25 12:16 ` Jan Kiszka
2008-08-25 12:21 ` Gilles Chanteperdrix
0 siblings, 1 reply; 5+ messages in thread
From: Jan Kiszka @ 2008-08-25 12:16 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai-core
Gilles Chanteperdrix wrote:
> Jan Kiszka wrote:
>> 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.
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
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Xenomai-core] Native skin: user space handles sharable between processes?
2008-08-25 12:16 ` Jan Kiszka
@ 2008-08-25 12:21 ` Gilles Chanteperdrix
2008-08-25 12:23 ` Jan Kiszka
0 siblings, 1 reply; 5+ messages in thread
From: Gilles Chanteperdrix @ 2008-08-25 12:21 UTC (permalink / raw)
To: Jan Kiszka; +Cc: xenomai-core
Jan Kiszka wrote:
> Gilles Chanteperdrix wrote:
>> Jan Kiszka wrote:
>>> 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.
>
> 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.
--
Gilles.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [Xenomai-core] Native skin: user space handles sharable between processes?
2008-08-25 12:21 ` Gilles Chanteperdrix
@ 2008-08-25 12:23 ` Jan Kiszka
0 siblings, 0 replies; 5+ messages in thread
From: Jan Kiszka @ 2008-08-25 12:23 UTC (permalink / raw)
To: Gilles Chanteperdrix; +Cc: xenomai-core
Gilles Chanteperdrix wrote:
> Jan Kiszka wrote:
>> Gilles Chanteperdrix wrote:
>>> Jan Kiszka wrote:
>>>> 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.
>> 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.
$CUSTOMER will like that, too: I'm going the easy way. :)
Jan
--
Siemens AG, Corporate Technology, CT SE 2
Corporate Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-08-25 12:23 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-25 11:36 [Xenomai-core] Native skin: user space handles sharable between processes? Jan Kiszka
2008-08-25 12:08 ` Gilles Chanteperdrix
2008-08-25 12:16 ` Jan Kiszka
2008-08-25 12:21 ` Gilles Chanteperdrix
2008-08-25 12:23 ` Jan Kiszka
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.