How to make rm-sessions upgradeable?
Norman Feske
norman.feske at ...1...
Sun Sep 16 12:36:48 CEST 2012
Hi Taru,
> When spawning more threads the rm-session from the env needs to be
> upgraded in various places. This can occur when spawning new threads and
> even in thread.start().
>
> Thus one needs a way to make the rm-session in env upgradeable from the
> outside.
there is already a bit of support for such upgrades in place. Please
have a look at 'base/include/base/platform_env.h'. The class behind
'env()->rm_session()' is actually an 'Expanding_rm_session_client',
which is meant to transparently upgrade the session quota as needed.
Right now, the implementation covers only the 'attach' function though.
For accommodating your concern, we should cover all functions that
implicitly consume session quota. In your actual case, this would be
'add_client'.
> A simple way to fix would be to define a
> class Upgradeable_rm_session : public Rm_session {
> void upgrade(const char *);
> };
The 'Platform_env::Expanding_rm_session' class looks actually quite
similar. Could you have look to see how it fits your needs?
> And make some private inheritance into protected inheritance
> i.e. Rpc_client into
> template <typename RPC_INTERFACE>
> struct Rpc_client : *protected* Capability<RPC_INTERFACE>, RPC_INTERFACE
> ...
Oh, you have just turned a public inheritance into a protected one. ;-)
If a 'struct' inherits a base class with no 'private/protected/public'
keyword, 'public' is default.
Cheers
Norman
--
Dr.-Ing. Norman Feske
Genode Labs
http://www.genode-labs.com · http://genode.org
Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
More information about the users
mailing list