Shashank <firstname.lastname@example.org> wrote:
What I am trying to do is have two independent applications (children , as
you pointed out) share and be able to access a certain environment variable.
If one of them makes a change to it, the other should see the change.
Assuming you’re trying to have this happen dynamically and symetrically –
that is, both children running, either one could change the value, both
need to be able to see the value, probably the best way to do this would
be to stick the data/information in shared memory. (This may require
notification of change – or just check the shared memory each time
value is needed, depending on frequency of use. It will, also,
probably require synchronisation to prevent on process from updating
the contents half-way through the access by the other – probably
If you know that one is going to be updating, and the other always
just looking at it, you could have the updater send a message to
the user of the environment variable with it.
If this is more of a dynamic configuration type thing, you may be
able to write a third program that checks what the value needs to
be, and returns that to the parent shell, which then exports the
correct value to be inherited by both the children.
The parent shell might do something like:
export YOUR_ENV_VAR =
And, program_to_findit would do something like:
env_value = function_to_find_it();
QNX Training Services