DataMuseum.dk

Presents historical artifacts from the history of:

RC4000/8000/9000

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about RC4000/8000/9000

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download

⟦769bb73df⟧ TextFile

    Length: 3840 (0xf00)
    Types: TextFile
    Names: »treadcom«

Derivation

└─⟦00964e8f7⟧ Bits:30007478 RC8000 Dump tape fra HCØ.
    └─⟦b2ec5d50f⟧ 
        └─⟦0b817e319⟧ »ctramos« 
            └─⟦this⟧ 

TextFile

readcommand 82.03.31
Anders Lindgård
:3: readcommand: claiming basic
maxcoru:=maxcoru+noofterminals+maxmess;
maxsem:=maxsem+no_of_terminals;
maxsemch:=maxsemch+1;
maxop:=maxop+noofterminals+1;
maxnettoop:=maxnettoop+8*(noofterminals+1);
maxprocext:=maxprocext+1;
maxmessext:=maxmessext+noofterminals;
:4: readcommand global variables and procedures
algol list.on;
integer ownpda,tpspda;
integer messaddress,attline;
boolean att,verify;
zone array c_buf(no_of_terminals,17,1,no_error);
algol copy.tchildpr;
algol copy.treaduscat;
algol copy.treadclist;

algol copy.tnextparam;

procedure readcommand(cno);
value cno; integer cno;
begin
integer rem,pda,termno,el;
integer array field cur;
boolean stop,waitc;
integer array field attref;
  stackclaim(800);
<*+2*>
  if testop(5) then writelog(<:readcommand:>,cno,<: started:>);
<*-2*>
  stop:=false;
  repeat
  waitc:=waitch(attline,attref,att or stopsystem,0);
<*+2*>
  if testop(5) then writelog(<:readcommand:>,waitc extract 12,<:remaining:>);
<*-2*>
  if (stopsystem and waitc) extract 12 =0 then
  begin
    pda:=d.attref(1);
<*+2*>
    if testop(5) then writelog(<:readcommand:>,pda,<: terminal :>);
<*-2*>
    termno:=findterm(pda);
    if termno=0 then termno:=nextfreeterm(pda);
<*+2*>
    if testop(5) then writelog(<:readcommand termno:>,termno,<::>);
<*-2*>
    cur:=curcondesc;
   inspect(condesc.cur.conaccess,el);
<*+2*>
   if testop(5) then writelog(<:con sem elements:>,el,<::>);
<*-2*>
    wait(condesc.cur.conaccess);
    readcommandlist(c_buf(termno),condesc.curcondesc,false);
    signal(condesc.cur.conaccess);
    signalch(attline,attref,free);
  end else stop:=true;
  until stop;
writelog(<:readcommand:>,cno,<:stopped:>);
end readcommand;

procedure receivemess(no);
value no; integer no;
begin
boolean stop;
integer array M,A(1:8);
integer array field taddress;
integer array field bufref,attref,pmessref;

stackclaim(350);
stop:=false;
<*+2*>
if testop(5) then writelog(<:receivemess started:>,no,<::>);
<*-2*>
repeat
  cwaitmessage(messaddress,M,bufref,0);
  taddress:=core.bufref(4);
  if core.taddress(1)=0 then
  begin
    <*parent message*>
<*+2*>
    if testop(5) then writelog(<:receive parent message:>,bufref,<::>);
<*-2*>
    waitch(pmessline,pmessref,free,0);
    d.pmessref(1):=taddress;
    d.pmessref(2):=bufref;
    signalch(pmessline,pmessref,pmess);
    osparentmess:=osparentmess+1;
  end else
  begin
   sendanswer(1,bufref,A);
   waitch(attline,attref,free,0);
   d.attref(1):=taddress;
   signalch(attline,attref,att or (stop and stopsystem));
   oscommunication:=oscommunication+1;
  end terminal;
until stop;
writelog(<:receivemess:>,0,<:finis:>);
end receivemess;
algol list.off;
:5: readcommand program
algol list.on;
att:=false add (1 shift 3);
attline:=nextsemch;
for i:=1 step 1 until noofterminals+1 do
begin
  j:=nextop(8);
  signalch(attline,j,free);
end;
for i:=1 step 1 until noofterminals do
begin
  fi:=(i-1)*condescsize;
  con_desc.fi.con_term_no:=i;
  condesc.fi.con_ref:=fi;
  condesc.fi.conaccess:=nextsem;
  signal(condesc.fi.conaccess);
end;
ownpda:=owndescr;
messaddress:=nextprocext(ownpda);
for i:=1 step 1 until maxmess do
begin
j:=nextcoru(1,100,true);
<*+2*>
if testop(7) then
write(out,"nl",1,<:receivemess coroutine :>,j);
<*-2*>
newactivity(j,j,receivemess,i);
end mess;
for i:=1 step 1 until noofterminals do
begin
  j:=nextcoru(2,100,true);
<*+2*>
  if testop(7) then
  write(out,"nl",1,<:readcommand corutine:>,j);
<*-2*>
  newactivity(j,0,readcommand,i);
end;
algol list.off;
▶EOF◀