Yet another question. Associated with "Re: Shared library"

Peter Nguyen peter.nguyen at ...29...
Sun Mar 7 03:32:55 CET 2010


Hi,

> I have the feeling you're mixing two distinct matters here. The issue
> Norman addressed in his email was "How to share memory buffers between
> applications". That is done via dataspaces that are referenced by
> dataspace capabilities (in Unix file descriptors) and could be
> attached to any virtual address space via region management (in Unix
> mmap()).

Well, I was wondering about how to share data between components, where the data
may be specified within a library eg. having a variable in a library that should
be shared between all components using this library.

> What do you want to say with this statement? Do you want the data to
> be shared? Do you want to prevent sharing of the data (which is
> perfectly achieved with shared libraries that only share the read-only
> segements
> http://en.wikipedia.org/wiki/Library_%28computing%29#Shared_libraries)?

I do want the data to be shared between genode apps that utilize the library. In
other words, i'd like there to essentially be a single copy of the variable that
is used by these apps/components (like static variables in Java).

> I propose to implement the "network sampling thread" in a profiling
> "server" that announces its "service" and provides "sessions" to its
> "clients" (e.g., the HTTP server). On startup, the client requests a
> "session" to "profiling" from its parent. Thereafter, it requests the
> dataspace capability via the "profiling session" interface and
> attaches the dataspace locally. The resulting virtual start address
> can be used to initilialize your sampling "library".

This makes sense. In reference to my responses above, I'm thinking there would
be a profiling session interface that defines the memory that can be shared,
have the server write data to this memory, and the clients can declare a
dataspace capability (via attaching the dataspace as you mentioned) to this
memory so as to read the contents of this memory. Am I on the right track?

Peter




More information about the users mailing list