?? inqueue3hrrn.m
字號:
%flag 'D'-diskqueue, 'R'-readyqueue
% the function use only for Readyqueue
function [Q,pos]=InQueue3HRRN(p,BeginToWaitTime,Tb,Q,Qlen,flag)
% disp('=========in InQueue3================');
i=1;
while i<=Qlen
if Q(i,1)==0
Q(i,1)=p;
Q(i,2)=Tb;
Q(i,3)=BeginToWaitTime; %never be 0 after running
pos=i;
% fprintf('In the p%d to QReady, start to wait at T=%d\n',p,BeginToWaitTime);
break;
end
i=i+1;
end
if i>Qlen
fprintf('The Queue(%c) is Full!\n',flag);
pos=-1; %could cause the TB(-1) in CPU.m
return;
end
%-----------------------------------
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -