UP

Super nodes provide the equivalent of an array of keys.

Snode Creator

The snode creator is prompt.

SNODE_CREATOR(0;SB1,M,SB2==>c;SNODE) {"create snode"}. If SB1 is not an official prompt space bank, c will be 1. If four nodes and one page cannot be obtained from SB1, c will be 2. If some space created from SB1 is zapped [define!] before the SNODE_CREATOR call returns, it may return either 2 or kt+1 in c or it may not return at all (but the SNODE_CREATOR remains prompt). If such space is zapped later, calls to the snode may do likewise. Otherwise, c will be 0 and SNODE will be the only key to a new snode. Space bank SB2 will be used to obtain space needed by the snode after the time of its creation. SB2 need not be an official space bank, but if it does not behave as a space bank there are no promises as to what the snode will do. The snode will run under meter M. SNODE will have write rights. The initial state of the snode is as if a "clear" had just been done.

SNODE_CREATOR(kt;==>c;) returns X'020D' in c.

Snode {"Super node"}

A snode is like a node in that it can store keys, except that a snode can store many more than 16 keys {up to 2**32, in principle}. The amount of storage used by a snode depends on the highest slot number of the snode that was stored into since the last "clear", so it is inefficient to use slot numbers sparsely. If x is the highest slot number stored into since the last "clear", the number of nodes {from SB2} used by the snode is at most {in Algol68}: x%15 - ENTIER(-ln(x)/ln(16)) {i.e., floor(x/15)+ceiling(log base16(x))}. If the snode's meter does not run out and SB2 is an official space bank and no space from SB1 or SB2 is zapped, all calls to a snode key without write rights are prompt.

{arcane} define "zapped".

If the space created from SB2 doesn't behave as expected {e.g., SB2 is an official space bank but space under it is zapped}, any of the operations below except kt may return -1 in c or may not return at all, or the operations may not behave as defined.

SNODE(41,((4,n));==>0;K) {"Fetch"}. Returns in K the contents of slot n of the snode.

If 0 <= n < 16, SNODE(n;==>0;K) returns in K the contents of slot n of the snode. {Cf. node}

SNODE(42,((4,n));K==>c;L) {"Store"}. If SNODE does not have write rights c will be kt+2 and the snode will remain unchanged. If the space bank (SB2 above) cannot supply enough space for the operation, c will be 2. Otherwise c will be 0 and key K is stored in slot n of the snode. L is the previous contents of the slot.

If 0 <= n < 16, SNODE(16+n;K==>c;L) does what SNODE(42,((4,n));K ==>c;L) does. {Cf. node}

SNODE(39;==>c;) {"Clear"}. If SNODE does not have write rights c will be kt+2. Otherwise c is zero and zero data keys are effectively stored into all slots of the snode.

SNODE(32;==>0;SNODE2) {"Restrict rights"}. Returns in SNODE2 a key to the same snode with no write rights.

SNODE(43;==>c;) {"Destroy"}. If SNODE does not have write rights c will be kt+2. Otherwise attempts to return all space used by the snode to the space bank that it came from, changes all keys to the snode to DK(0) and then returns with c=0. Any keys stored in the snode are lost.

SNODE(kt+4;==>c;) Same as SNODE(43;==>c;).

SNODE(kt;==>c;) returns X'030D' in c.

{nonref}{ni}Virtual copies and sparse super-nodes:

We propose to provide virtual copies of supernodes. The strategy for this also would provide for sparse supernodes {supernodes that did not use real nodes that only hold DK(0)}.

The scheme implements a virtual copy much like a supernode. The new part of the supernode would be built as a sparse supernode. Portions of the virtual copy like the original would be referred to by a distinguished key {such as a fetch key or a node key with a distinctive databyte}.

{arcane}The current plans for the "forked-time" facility {(formative,forkedtime)} for PL/I assumes copies of supernodes, preferably virtual.