“Markus Loffler” <loffler@ces.clemson.edu> wrote in message
news:9d6fal$mbj$1@inn.qnx.com…
In my application, I’m having problems guaranteeing real-time behavior. I
have a periodic interrupt of a timer board at a frequency of 1KHz. I’m not
able to keep the response time < 1ms, even on GHz PCs. My process is the
only one that runs priority 63. The only system calls I’m making are:
[snip]
Anything I’m doing wrong here? I have the feeling that maybe the call of
TimerTimeout is not good here.
Thanks in advance
Markus
Hello, this is my finding I posted to this news group in January…
As far as I know this issue was not solved.
Pavol
Pavol Kycina
Microstep-HDO, s.r.o.
Bratislava, Slovakia
In order to be able to divide code between irq handler
and thread efficiently I was playing a bit with QNX RTP.
I tried to follow this rules:
thread “scheduled from handler” is high priority… 63
measure ellapsed time with ClockCycles
print data in other normal priority thread
use bare CPU board (no network, sound, SMM, …)
run program from boot-image (no filesystem, …)
My program does sth like this:
irq_handler () {
remember value of ClockCycles
return event to wake thread
}
thread() {
while(1){
InterruptWait()
remember value of ClockCycles
count min, max, average difference
}
}
main(){
while(1){
print counted values
}
}
And my findings are that sometimes it takes
almost !!! 1ms !!! from interrupt handler to thread.
(I measured it on 266MHz AMD K6)
The easiest way to make the difference large is to
start pidin on other console.
I am attaching my src code and also build file.
begin 600 qnx5.build
M6W-E87)C:#TN.B]S8FEN.B]U<W(O<V)I;CHO8FEN.B]U<W(O8FEN.B]L:6(Z
M+VQI8B]D;&PZ+V)O;W0O<WES70T6W9I<G1U86P]>#@V+&)I;W,@V-O;7!R
M97-S72!B;V]T(#T@>PT"7-T87)T=7M8FEO<R
M<RV-&L@+78-"@E0051( M/2]P<F]C+V)O;W0Z+V)I;CHO=7-R+V)I;B!,1%],24)205)97U!!5$@]+W!R M;V,O8F]O=#HO;&EB.B]U<W(O;&EB.B]L:6(O9&QL('!R;V-N=&\-"GT-"@T* M6RMS8W)I<'1=("YS8W)I<'0@/2![#0H)9&5V8RUC;VX@+6XT("8-"B,)9&5V M8RUS97(X,C4P("U&("UE("8-"@ED979C+7-E<C@R-3
@+64@)@T"0T*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8T7W0)"0D)8U]N;W<@/2
P+”!C7V]L9"](#
L(&-?
M=&UP+”!S=6U?879G.PT*#0IC;VYS=”!S=’)U8W0@<VEG979E;G0J(&ES<E]H
M86YD;&5R*‘9O:60@F%R9RP@:6YT(&ED0T*>PT*“0T*“6-?;F]W7VEI(#T@
M0VQO8VM#>6-L97,H3L-"@D-"@ER971U<FXH)F5V96YT3L-“GT-”@T*=F]I
M9"H@:6YT7W1H<F5A9”@@=F]I9”J87)G*0T*>PT*"6EN="
@("@("
@("@ M("
@("@("
@("!R970[#0H)<W1R=6-T(’-C:&5D7W!A<F%M"7!A<F%M.PT*
M#0H)+R@:6YI8VEA;&EZ=6H@979E;G0-"@E324=%5E])3E127TE.250H(“9E
M=F5N=“D[#0H-”@DO+V5N86)L92!I+V@<’)I=FEL96=E#0H)<F5T(#T@5&AR
M96%D0W1L7W(H7TY43U]40U1,7TE/+”!.54Q,3L-"@EI9BAR970@/"P*7L- M"@D)<')I;G1F*").96UA;2!P<F%V82!N82!)3R!O<&5R86-I95QN(BD[#0H) M"6=O(#T@,#L-"@D)<F5T=7)N.PT*"7T-"@D-"@EP87)A;2YS8VAE9%]P<FEO M<FET>2
](#8S.PT"7)E="](%-C:&5D4V5T7W(H,"P@,"P@4T-(141?3D]# M2$%.1T4L("9P87)A;2D[#0H):68H<F5T(#P@,"E[#0H)"7!R:6YT9B@B3F5P M;V1A<FEL;R!S82!Z;65N:70@<')I;W)I='5<;B(I.PT*"0EG;R
](#[#0H) M"7)E='5R;CL-"@E]#0H-"@ER970@/2!);G1E<G)U<'1!='1A8V@H,"P@:7-R M7VAA;F1L97(L($Y53$PL(#
L(#I.PT*"6EF*')E="
(#I>PT*"0EP<FEN M=&8H(DYE;6]Z96T@<V$@<')I<&]J:70@;F$@<')E<G5S96YI95QN(BD[#0H) M"6=O(#T@,#L-"@D)<F5T=7)N.PT*"7T-"@T*"7=H:6QE*#$I>PT*"0E);G1E M<G)U<'1786ET*#
L($Y53$PI.PT*“0D-”@D)8U]O;&0@/2!C7VYO=U]I:3L-
M"@D)8U]N;W<@/2!#;&]C:T-Y8VQE<R@I.PT"0EI9BAC7VYO=RF)B!C7V]L M9"E[#0H)"0EC7W1M<"
](&-?;F]W("T@8U]O;&0[#0H)“0EI9BAC7W1M<”^ M(&-?9&EF9E]M87@I>PT*"0D)"69L86=?879G(#T@,#L-"@D)"0EC7V1I9F9? M;6%X(#T@8U]T;7
[#0H)"0E](&5L<V4@:68H(&-?=&UP(#P@8U]D:69F7VUI
M;BE[#0H)"0D)8U]D:69F7VUI;B](&-?=&UP.PT*"0D)"69L86=?879G("
]
M(#[#0H)"0E](&5L<V4@>PT*"0D)"6EF*&9L86=?879G(#T](#
I>PT"0D)
M"0ES=6U?879G(#T@,#L-"@D)"0E]#0H)"0D)9FQA9U]A=F<KSL-"@D)"0ES
M=6U?879G("L](&-?=&UP.PT"0D)"6EF*&9L86=?879G(#T](#$P,#I>PT* M"0D)"0EC7V1I9F9?879G(#T@<W5M7V%V9R
O(&9L86=?879G.PT*"0D)“0EF
M;&%G7V%V9R](#
[#0H)“0D)?0T*“0D)?0T*“0E]#0H)?0T*?0T*#0H-“FUA
M:6XH0T>PT*“6EN=D)=&ED.PT*"7!T:')E861?8W)E871E*"
F=&ED+”!.
M54Q,+”!I;G1?=&AR96%D+”!.54Q,*3L-”@EP<FEN=&8H(E1H<F5A9”!M82!I
M9”E9%QN(BP@=&ED*3L-"@T*"7=H:6QE*&=O*7L-"@D)<')I;G1F*")D:69F M(&IE(&UI;BXN+B5D(&%V9RXN+B5D(&UA>"XN+B5D(%QN(BP@8U]D:69F7VUI M;BP@8U]D:69F7V%V9RP@8U]D:69F7VUA>"D[#0H)"7-L965P*#(I.PT*"7T- M"@T*"7!R:6YT9B@B4')E<G5S96YI92!S:V]N8VEL;RP@87-I(&YE:F%K82!C 2:'EB85QN(BD[#0I]#0H-"@T*
end