Plan: the chat server as an RT program, the client as a reentrant subsystem¶
Written 2026-08-18. Two changes that turn the chat from a demo into something the machine hosts. Everything below is marked VERIFIED (measured or quoted from a manual) or NOT ESTABLISHED.
Why, in one line each¶
The server should be RT because it currently eats one of D100's three terminal lines, needs somebody logged in, and dies when that line goes.
The client should be reentrant because every user who types @CHAT today gets a private copy of
the whole program image, and the room seats sixteen.
What is already true, and it is more than expected¶
VERIFIED on D100, 2026-08-18 - three demo users created (OLAV, ANNA, KARI, 200 pages each,
blank passwords) and used:
- an ordinary user can already run the client. Logged in as
OLAV,@CHATstarted, prompted for a nickname, joined, and the room answered. The program lives underSYSTEMand SINTRAN found it unqualified; - an ordinary user can create files in their own area.
@CREATE-FILE CHAT:CNFG,1asOLAVsucceeded. That is the whole storage requirement for task [59]; - the seat accounting survives it - see
PLAN-2026-08-18.md, phase 2.
So neither change is needed to make the chat WORK for several users. Both are about how the machine hosts it, and saying that plainly matters: it stops either being sold as a bug fix.
Part A - CHATSV as an RT program¶
What is verified¶
- XMSG is available to RT programs. The error list has
XEIRT, "Illegal function for RT-programs (only drivers)", which by its own wording is the exception rather than the rule, and the COSMOS guide's sample server is an RT program. - Termination still cleans up.
XMPFDCTruns automatically "on log out or RT program termination" and closes every port, which clears the XROUT name. Measured for the background case; the manual states the RT case in the same sentence. - The loader exists and the recipe is on disk.
@RT-LOADER, thenDECLARE-PROG,CHANGE-RT-DES,END-LOAD- a worked example is inReference-Manuals\210166F SIBAS II for ND-100.mdaround line 1105.
The one real problem: OUTPUT(1, ...)¶
CHATSV prints its banner, its refusals and now its reap lines to device 1, the caller's terminal. An RT program has no caller and no terminal.
NOT ESTABLISHED: what device 1 does for an RT program on this machine. Three candidates, in the order they should be tried, cheapest first:
- Give the program a terminal number of its own and print there - a spare line, or the console. Keeps every diagnostic exactly as it is.
- Write to a file opened at start-up. Survives a restart and can be read while the server runs, which the terminal version cannot.
- Drop the prints. Cheapest to write and the worst to live with - the reap line is how a vanished member is noticed at all.
Recommended: 2, with 1 as the fallback. A server nobody is watching needs a log, not a screen.
Order of work¶
- decide the output route above, by measuring what device 1 does from an RT program;
- change
CHATSV.PLNCto open its log once at start-up; - build as now (the BRF and linker steps do not change);
@RT-LOADER/DECLARE-PROG/CHANGE-RT-DES/END-LOAD;- prove it the same way phase 2 was proved:
LIST-NAMESshowsCHAT-LOBBYwith 16 free, two users join from two terminals, one is killed, the survivor speaks, the seat comes back; - only then add it to the boot chain.
What it buys, concretely¶
Three terminal lines is the whole of D100. The server holding one is why this session needed a third
telnet session to run a two-client test at all, and why an earlier STOP-TERMINAL on the server's
line produced the lingering name that task [61] was wrongly written about.
Part B - CHAT as a reentrant subsystem¶
What is verified¶
- The command is
DUMP-REENTRANT, and it takes a name, a start address, a restart address and a:BPUNfile:@DUMP-REENTRANT PLANC-100,0,1,<input-file>- fromReference-Manuals\ND-10309B PLANC FOR ND-100.md, which is the PLANC compiler installing ITSELF. The four arguments line up with the four columnsLIST-REENTRANTprints. LIST-REENTRANTon D100 already shows six of them - MAC, NPL, PLANC-100, PED, FORTRAN-100 - so the mechanism is live on this machine, not theoretical.
The one real problem: our data is in the code¶
A reentrant subsystem is one copy of the code shared by every user, with each user's data
somewhere else. CHAT.PLNC keeps everything at module level - inBuf, outBuf, typed,
myName, myPort, serverMagic, the lot. In a single-bank build those sit in the same bank as
the code, so two users sharing the code would share myName and serverMagic too.
This is the whole of the work, and it is why the change is bigger than part A despite sounding smaller.
- the build uses
PLANC-1BANK-F00; PLANC-2BANK-F00exists and is already referred to inCHAT.PLNC's own notes (both were loaded when hunting5MON_P);- NOT ESTABLISHED: that the two-bank runtime is sufficient, or what else a PLANC program must do to be dumped reentrant. The PLANC manual documents the compiler doing it to itself, which is the best available worked example and should be read in full before any code is changed.
Order of work¶
- read the PLANC manual's own installation section end to end - it is the only worked example of a PLANC program being made reentrant, and it is on disk;
- establish what separates code from data in a two-bank build, and what that means for
module-level
BYTESarrays; - rebuild
CHATagainstPLANC-2BANK-F00and check it still runs as an ordinary program - a step that can fail cheaply and tells you a lot; - produce a
:BPUNandDUMP-REENTRANTit; - prove it with the demo users:
OLAVandANNAin the room at the same time, each with their own nickname, andLIST-REENTRANTshowing oneCHAT.
Step 5 is the point of the demo users. Two people sharing one copy of the code while keeping separate nicknames is exactly the failure a shared-data bug would produce, and nothing short of two real users at once will show it.
How this meets task [59], CHAT:CNFG¶
The three are one piece of work and should be sequenced together:
- [59] first, as an ordinary program.
OLAValready has aCHAT:CNFGin their own area; the client reads it at start-up instead of prompting, and writes it when/nicksucceeds. No reentrancy needed, provable today, and it makes the demo users worth having. - Part B second. Per-user config is the strongest possible test of per-user data: if the
reentrant build shares one
myName, two users will disagree about who they are and the config file will say so. - Part A whenever convenient. It is independent of both.
Demo users created 2026-08-18¶
| machine | users | space | password |
|---|---|---|---|
| D100 | OLAV, ANNA, KARI |
200 pages | blank |
D102 and D103 are not done. terminal_connlist holds D102 at localhost:9102; D103 has no
entry, so its port has to be read out of RetroCore.ini rather than guessed. Users there are only
needed for federation, task [58], and creating them before that work starts would be guessing at
what it needs.