?? 列表5.11.txt
字號:
【列表5.11】 priTest程序代碼。
{
priTest - illustrate process priorities
}
program priTest;
{$APPTYPE CONSOLE}
uses SysUtils, Libc;
var
forkRslt : __pid_t;
i,
LoopCount : integer;
s : String;
begin
forkRslt := fork;
if forkRslt = 0 then
begin
s := 'Child';
end
else if forkRslt > 0 then
begin
s := 'Parent';
// set child's priority
if setpriority (PRIO_PROCESS, forkRslt, 10)= -1 then
perror ('Error setting priority');
end
else
begin
perror ('Error in fork');
exit;
end;
LoopCount := 0;
repeat
WriteLn (Format ('%s=%d', [s, LoopCount]));
Inc (LoopCount);
//little delay loop
for i:=1 to 10000000 do ;
until false;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -