📄 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 + -