[DGD] Code libraries for DGD and Hydra

Felix A. Croes felix at dworkin.nl
Tue Sep 18 18:46:40 CEST 2018


DGD and Hydra are compatible: what runs on DGD (without optional
extensions) also runs on Hydra, and vice versa.  However, most
existing LPC code written for DGD does not take advantage of Hydra's
advanced capabilities.

For instance, the LPMud 2.4.5 simulation code stores the current value
of this_player() in a central object, which will therefore be modified
by almost every task.  As a result, these tasks cannot be run
concurrently.  This design idea was unfortunately copied by other
mudlibs.

The kernel library, which I wrote to build next-generation mudlibs
upon, solves this problem with an implementation of Thread-Local
Storage, which is also more efficient on DGD and thus an all-round
benefit.  But the kernel library predates Hydra by a decade, and
other assumptions that prevent parallelization crept in.

The kernel library uses a double-linked list of objects per owner.
This makes it impossible to run two tasks that create or destroy
objects with the same owner concurrently.  Even worse, the resource
management system imposes hard limits on resource usage per owner,
which can only be implemented with centralized administration, once
again preventing concurrency.

Worst of all, the kernel library managed callouts as a resource, in
a manner that prevented concurrent execution of callouts.  In the
last few changes to the kernel library I removed callouts as a
resource, but then I realized that this was just the tip of the
iceberg.  Moreover, the kernel library promised stability, and I
could not rewrite it from the bottom up for Hydra without causing
its users a lot of pain.

This is why I halted development of the kernel library as such, and
integrated it into the Cloud Server library, which is expressly
designed to take advantage of what Hydra offers.  Snapshots of the
kernel library extracted from the cloud library are on the cloud-0.7
branch of the kernel library.  Existing mudlibs built upon the
kernel library may be able to use them, but this has not been tested.

In the next few postings, I intend to discuss the specific
requirements that are imposed on a code library which wants to take
advantage of Hydra.

Regards,
Felix Croes



More information about the DGD mailing list