|
DataMuseum.dkPresents historical artifacts from the history of: RC4000/8000/9000 |
This is an automatic "excavation" of a thematic subset of
See our Wiki for more about RC4000/8000/9000 Excavated with: AutoArchaeologist - Free & Open Source Software. |
top - metrics - download
Length: 3072 (0xc00) Types: TextFile Names: »twatchdog«
└─⟦00964e8f7⟧ Bits:30007478 RC8000 Dump tape fra HCØ. └─⟦b2ec5d50f⟧ └─⟦0b817e319⟧ »ctramos« └─⟦this⟧
watch dog 1981.12.01 Anders Lindgård :1: watch dog: global definitions integer field t_pda,t_count,t_prio; long field t_starttime,t_runtime,t_lasttime; integer array field t_last; integer scan_time_slice,percentmax,tot_percentmax,maxcount,priochange; :2: watch dog: initialization of globals i:=t_pda:=2; i:=t_count:=i+2; i:=t_prio:=i+2; i:=t_starttime:=i+4; i:=t_runtime:=i+4; i:=t_lasttime:=i+4; i:=t_last:=i+4; readifp(<:watchscan:>,scantimeslice,50); readifp(<:watchcount:>,max_count,6); readifp(<:watchprio:>,priochange,2); readifp(<:watchpc:>,percentmax,35); readifp(<:watchtot:>,totpercentmax,10); :3: watch dog: claiming basic maxcoru:=maxcoru+1; :4: watch dog global variables and procedures algol list.on; integer array table(1:maxchildren*t_last//2); procedure watch_dog; begin integer i,j,res,percentcur,percenttot,cno,rep; long array name(1:3); long drealt,drunt,realtime,runtime,now; integer array field cpda,tt,ct; long array field name_f; stackclaim(950); for i:=maxchildren*t_last//2 step -1 until 1 do table(i):=0; rep:=0; repeat rep:=rep+1 mod 10; delay(scan_time_slice); now:=getclock; for cno:=1 step 1 until maxchildren do begin ct:=(cno-1)*ct_size; tt:=(cno-1)*t_last; cpda:=child_table.ct.ct_childpda; if cpda>0 then begin if table.tt.tpda<>cpda or core.cpda.starttimeref<> table.tt.t_starttime then begin <*new child*> table.tt.t_pda:=cpda; table.tt.tprio:=0; table.tt.t_count:=0; table.tt.t_starttime:= table.tt.t_lasttime:=core.cpda.starttimeref; table.tt.t_runtime:=0; end; realtime:=now-core.cpda.starttimeref; runtime :=core.cpda.runtimeref; drealt:=now-table.tt.t_lasttime; drunt:=runtime-table.tt.t_runtime; if drealt>0 and realtime>scan_time_slice then begin if table.tt.t_count>0 then table.tt.t_count:=table.tt.t_count+1; percentcur:=drunt*100/drealt; percenttot:=runtime*100/realtime; name_f:=cpda+2; for i:=1,2 do name(i):=core.namef(i); if percentcur>percentmax then begin res:=set_priority(name,priochange); table.tt.t_prio:=table.tt.tprio+priochange; table.tt.t_count:=1; end else if tcount>maxcount and percenttot<tot_percentmax then begin res:=set_priority(name,-priochange); table.tt.t_prio:=table.tt.t_prio-priochange; table.tt.t_count:=0; end; end realtime>0; end pda>0; end cno; until false; end watch dog; algol list.off; :5: watch dog message: program algol list.on; j:=nextcoru(9,40,true); newactivity(j,j,watch_dog); <*+2*> if testop(2) or testop(7) then write(out,"nl",1,<:watch dog coroutine :>,j); <*-2*> algol list.off; ▶EOF◀