Hi Chen,
I do not quite understand what you mean with "print". Are you referring to the pointers returned by said functions? If yes, what information do you expect to gain from these local address values? The 'env()' function returns a local object that represents the environment of the process as created by the parent. The object is normally located within the BSS segment of the program. See the implementation of the 'env()' function at ' base/src/base/env/env.cc'. The class implementing the 'Env' interface can be found here: 'base/include/base/platform_env.h'.
When 'env()' is called for the first time, the single 'Platform_env' object is constructed ('_env' is a local static variable of 'env()'). Upon construction, 'Platform_env' requests the process's CPU, RAM, RM, and PD session from the parent interface by specifying the corresponding service names prefixed with "Env::" as argument to the 'parent()->session()' call. At the parent side, these session requests are especially handled. See 'base/include/base/child.h'. This way, the child process retrieves the environment information from its parent. In the 'Child' class, you can see that for these "Env::" sessions, the parent returns capabilities taken from the local 'Child' object context.
Best regards Norman
On 06/16/2011 02:57 AM, Chen Tian - SISA wrote:
Thanks for the reply.
I printed "env()", "env->ram_session()" and "env()->rm_session()" of core, init, and another three apps: test-timer, myapp1 and myapp2. I don't understand why I get the same set of values for myapp1 and myapp2? The sets of value for others are different.
Best, Chen