next up previous contents
Next: The HsPersistentObjectService Up: The HsResourceControlService Previous: The HsResourceControlService

Future Improvements

As with most of the Haystack services, a number of improvements can be made to increase the functionality of the HsResourceControlService. Specifically, it would be value to provide some sort of deadlock detection or two-phase locking. The HsResourceControlService could easily maintain some sort of ordering on the resources.

This type of locking can be achieved by holding some function r mapping resource names uniquely to some sortable numerical value: r(name) = iname, where name is the resource name, and iname is the unique numerical value for that name. Instead of merely invoking the above functions with the a resource name, services would also send a pointer to themselves. The HsResourceControlService could then maintain a list of resources held by each service, and only allow a new lock to be allocated if r(newName) > r(mostRecentLock). Releases are done in reverse. The function r would, of course, need to be predefined.



Copyright 1998, Eytan Adar (eytan@alum.mit.edu)