how to call a function from within an other process without

Hello.

Due to performance optimisation, I’d like to call a function from a foreign
process space on the same local machine without the operating system doing a
context switch (which consumes lots of cycles). Is there a possibility to do
such thing? Has somebody already done this? Do example code and compiler
configurations exist?

Thanks.

Nnamdi

Nnamdi Kohn <nnamdi.kohn@tu-bs.de> wrote:

Hello.

Due to performance optimisation, I’d like to call a function from a foreign
process space on the same local machine without the operating system doing a
context switch (which consumes lots of cycles). Is there a possibility to do
such thing? Has somebody already done this? Do example code and compiler
configurations exist?

This is not possible.

What behaviour are you expecting this to exhibit?
– what stack would it use?
– if this “remotely” called function modified a global variable,
what would happen?

Could you just link the function into both process and call it locally?

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com

What behaviour are you expecting this to exhibit?
– what stack would it use?
– if this “remotely” called function modified a global variable,
what would happen?

Could you just link the function into both process and call it locally?

our system architecture is to show dynamic behavior for the users. We would
like to combine the “test”-portions of the code of any user application into
one central process. Doing this, we might be able to avoid some context
switches, by dynamically changing our system architecture based on the
pre-calculations with the “test”-portions of every user’s code).
We can not link single functions (statically) to this process, because at
execution time we don’t even know which processes might be part of our
software system.

Is there a possibility to reserve shared memory from QNX and put executable
code into that region?

Nnamdi

“Nnamdi Kohn” <nnamdi.kohn@tu-bs.de> wrote in message
news:clthtc$6ct$1@inn.qnx.com

What behaviour are you expecting this to exhibit?
– what stack would it use?
– if this “remotely” called function modified a global variable,
what would happen?

Could you just link the function into both process and call it locally?

our system architecture is to show dynamic behavior for the users. We
would
like to combine the “test”-portions of the code of any user application
into
one central process. Doing this, we might be able to avoid some context
switches, by dynamically changing our system architecture based on the
pre-calculations with the “test”-portions of every user’s code).
We can not link single functions (statically) to this process, because at
execution time we don’t even know which processes might be part of our
software system.

Is there a possibility to reserve shared memory from QNX and put
executable
code into that region?

That’s called a share object or dll.

Nnamdi

Nnamdi Kohn <nnamdi.kohn@tu-bs.de> wrote:

What behaviour are you expecting this to exhibit?
– what stack would it use?
– if this “remotely” called function modified a global variable,
what would happen?

Could you just link the function into both process and call it locally?

our system architecture is to show dynamic behavior for the users. We would
like to combine the “test”-portions of the code of any user application into
one central process. Doing this, we might be able to avoid some context
switches, by dynamically changing our system architecture based on the
pre-calculations with the “test”-portions of every user’s code).
We can not link single functions (statically) to this process, because at
execution time we don’t even know which processes might be part of our
software system.

Is there a possibility to reserve shared memory from QNX and put executable
code into that region?

The usual choice for what you want to do – dynamic reconfiguration –
is through shared objects/dynamically linked libraries.

The dlopen() and dlsym() library routines are used to load the shared
library, and resolve symbols in it.

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com