[cap-talk] Object Allocation

Neal H. Walfield neal at walfield.org
Fri Jul 6 09:28:46 EDT 2007


As a way of studying memory resource allocation policies and
mechanisms, I'm developing a system which has at its center a resource
manager, which implements objects that resemble EROS's space banks.

The most important object is the activity object, which encapsulates a
resource principal.  The resource manager currently also implements a
number of objects corresponding to some common basic scarce resources
including tasks, threads, pages of memory and disk bandwidth.  To
allocate these objects, a principal passes an activity and gets one of
these fundamental objects back.

The question that has arisen is what object do I invoke when I
allocate, e.g., a task.  I suspect that just as an activity does not
know how to allocate a file (which is essentially just a collection of
basic resources), it should not know how to allocate a task.  That is,
I don't do activity->allocate_file and neither should I do
activity->allocate_task.

But if not invoking an activity object to allocate a basic object,
what then?  In the case of the file, a capability naming a file server
makes sense, e.g., fs->allocate_file.  But where did this fs object
come from?  Presumable, it was created by some file server
factory/builder, which knows how to instantiate these types of objects
given some more basic resources.  (And where does the factory builder
come from...?)

For basic resources, it seems to me that there must be some sort of
"static constructor".  The questions I have are: is this a good model;
is this just a bootstrap problem that I should, perhaps, ignore; and,
assuming your answers do not render the following non-sense, how does
a task get access to the static constructor so that it can invoke the
allocate constructor to allocate an object?

Thanks,
Neal


More information about the cap-talk mailing list