Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2006-07-16 08:26:40


Hi guys,

The thread "Low-level precision timer proposal" has raised and
collected a lot of good ideas and sketchy implementations. I think we
can't do any better than that without commenting on real code. That's
basically the purpose of this "Part II" (it follows up on the original
thread, so those of you who use the NNTP interface might see this
message there, depending on news client settings).

NOTE:

   All relevant comments have been inserted in the source files
   (attached). I would have never remembered all points to bring
   attention to if I had to write them down when composing this
   message.

   Some code could perhaps be factored out and shared between
   different components.

--
[ Gennaro Prota, C++ developer for hire ]
[    resume:  available on request      ]
begin 644 low_level_timers.hpp
M+R\@+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+0T*+R\@;&]W+6QE=F5L('1I;65R<PT*+R\-"B\O("A#*2!'
M96YN87)O(%!R;W1A(#(P,#8-"B\O#0HO+R!-86YY('1H86YK<R!T;R!0879E
M;"!6;WIE;FEL96L_at_9F]R(&-O;G-T<G5C=&EV90T*+R\@92UM86EL(&1I<V-U
M<W-I;VXL('=H96X@=&AE<V4@=V5R92!J=7-T('9A9W5E#0HO+R!I;G1E;G1S
M(&EN(&UY(&UI;F0_at_.BD-"B\O#0HO+R!0<F5L:6UI;F%R>2!V97)S:6]N+"!F
M;W(@8F]O<W0_at_9&5V96QO<&5R<R!L:7-T(&]N;'DN#0HO+R`M+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM#0H-"B\O('1I;65R(&-L87-S97,-"B\O#0HO+R!->2!I;FET:6%L(&=O
M86QS('=E<F4Z#0HO+PT*+R\@,2X_at_4')O=FED93H-"B\O("`M('=A;&P_at_8VQO
M8VL@=&EM97(@*'5S97(O<WES=&5M*0T*+R\@("T@<')O8V5S<R!T:6UE<B`H
M=7-E<B]S>7-T96TI#0HO+R`@+2!T:')E860@=&EM97(@("AU<V5R+W-Y<W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`@
M("`@("\O(")S>6YC:')O;FEZ960B('-T87)T#0H@("`@("`@('-T9#HZ8VQO
M8VM?="!S.PT*("`@("`@("!C;VYS="!S=&0Z.F-L;V-K7W0@:R`]('-T9#HZ
M8VQO8VLH*3L-"B`@("`@("`@9&\@>R!]('=H:6QE("AK(#T]("AS/7-T9#HZ
M8VQO8VLH*2DI.PT*#0H@("`@("`@('-T87)T7W1I8VL@/2!S.R`O+R!G<',@
M*ST_#0H@("`@?0T*#0H-"B`@("`O+R!S:&]U;&0@=&AI<R!B92!N86UE9"!C
M=7)R96YT*"D_("\O(&=P<PT*("`@('1I;65?9'5R871I;VY?='EP92!E;&%P
M<V5D*"D_at_8V]N<W0@("`@("`@("`@("`@("\O(%M)70T*("`@('L-"B`@("`@
M("`@+R\@9W!S("AI9B!T:&ES(&ES(#P@,"!W92!S:&]U;&0@=&AR;W<I#0H@
M("`@("`@("\O(&%N9"!P<F]B86)L>2!R971U<FX_at_82`B;F]T(')E;&EA8FQE
M(@T*("`@("`@("`O+R!I;F1I8V%T:6]N('=H96X_at_96QA<'-E9"`]/2`P#0H@
M("`@("`@("\O#0H@("`@("`@("\O(&%L<V\L('=I=&@@=&AE('-A;64@=&5C
M;FEQ=64@=7-E9"!F;W(-"B`@("`@("`@+R\@(G-Y;F-H;VYI>F5D('-T87)T
M(B!W92!C;W5L9"!M86ME(&$@<F%W#0H@("`@("`@("\O(&5S=&EM871E(&]F
M('1H92!M96%S=7)E;65N="!E<G)O<@T*#0H@("`@("`@(&-O;G-T('-T9#HZ
M8VQO8VM?="!E;&%P<V5D(#T_at_8VAE8VME9%]R971R:65V92_at_I("T@<W1A<G1?
M=&EC:SL-"@T*("`@("`@("!R971U<FX_at_96QA<'-E9"`^/2`P#0H@("`@("`@
M("`@("`_('1O7W1I;65?9'5R871I;VXH96QA<'-E9"D-"B`@("`@("`@("`@
M(#H@*&1O7W1H<F]W*"DL('1I;65?9'5R871I;VY?='EP92_at_I*3L-"B`@("!]
M#0H-"G!R:79A=&4Z#0H@("`@+R\@=V4@=7-E('-T9#HZ8VQO8VM?="!D:7)E
M8W1L>2!H97)E(&%T('1H90T*("`@("\O('!R:79A=&4@;&%Y97(L('1O(&%V
M;VED(&%N>2!A9&1I=&EO;F%L(&]V97)H96%D#0H@("`@+R\-"B`@("!S=&%T
M:6,@<W1D.CIC;&]C:U]T(&-H96-K961?<F5T<FEE=F4H*0T*("`@('L-"B`@
M("`@("`@8V]N<W0@<W1D.CIC;&]C:U]T(&9A:6P@/2`H8VQO8VM?="DM,3L-
M"@T*("`@("`@("!S=&0Z.F-L;V-K7W0_at_8W5R<F5N=#L-"B`@("`@("`@:68@
M*&9A:6P@(3T@*&-U<G)E;G0]<W1D.CIC;&]C:R_at_I*2D-"B`@("`@("`@("`@
M(')E='5R;B!C=7)R96YT.PT*("`@("`@("!E;'-E#0H@("`@("`@("`@("!D
M;U]T:')O=R_at_[hidden]*#0H@("`@("`@(')E='5R;B`P.R`O+R!G<',@<VEL96YC
M92!C;VUP:6QE<B!W87)N:6YG<PT*("`@('T-"@T*("`@('-T871I8R!T:6UE
M7V1U<F%T:6]N7W1Y<&4-"B`@("!T;U]T:6UE7V1U<F%T:6]N("\J('-O<G0@
M;V8_at_82!C<F5A=&5?=&EM92_at_I*B\H<W1D.CIC;&]C:U]T(&5L87!S960I#0H@
M("`@>PT*("`@("`@("`@('5S:6YG(&)O;W-T.CIP;W-I>%]T:6UE.CIS96-O
M;F1S.PT*("`@("`@("`@('5S:6YG(&)O;W-T.CIP;W-I>%]T:6UE.CIM:6QL
M:7-E8V]N9',[("\O(#$P=&@@;V8@<V5C;VYD<S\@+2UG<',-"@T*("`@("`@
M("`@("\O(&YO=&4@=&AA="!#3$]#2U-?4$527U-%0R!H87,@='EP92!C;&]C
M:U]T+`T*("`@("`@("`@("\O('=H:6-H(&ES;B=T(&YE8V5S<V%R:6QY(&EN
M=&5G<F%L#0H@("`@("`@("`@='EP961E9B!B;V]S=#HZ:6YT-C1?="!M<U]T
M>7!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
M;&]C:U]D979I8V4@+R\@8F%S960@;VX_at_5VEN,S(G<R!'9710<F]C97-S5&EM
M97,H*0T*>PT*<'5B;&EC._at_T*("`@("\O('1Y<&5D968@=&EM95]T>7!E.CID
M871E7W1Y<&4@("`@("`@("`@=&EM95]P;VEN=%]T>7!E.R`O+R!G<',@+2!N
M965D960_#0H@("`@='EP961E9B!B;V]S=#HZ<&]S:7A?=&EM93HZ=&EM95]D
M=7)A=&EO;B!T:6UE7V1U<F%T:6]N7W1Y<&4[#0H-"B`@("`O+R!C=&]R#0H-
M"B`@("!V;VED('-T87)T*"D[("\O(&=P<R`M('1H<F]W<R!O;B!F86EL=7)E
M(#\-"B`@("!T:6UE7V1U<F%T:6]N7W1Y<&4_at_96QA<'-E9"@I(&-O;G-T.PT*
M#0IP<FEV871E._at_T*#0H@("`@='EP961E9B!B;V]S=#HZ=6EN=#8T7W0_at_86UO
M=6YT7W1Y<&4[#0H-"B`@("!S=&%T:6,@=F]I9"!R971R:65V92AA;6]U;G1?
M='EP92`F(&ME<FYE;"P_at_86UO=6YT7W1Y<&4@)B!U<V5R*0T*("`@("`@("`O
M+R!D969I;F4@(FEN;&EN92(@9F]R(&)R979I='D-"B`@("![#0H@("`@("`@
M(&-O;G-T(&EN="!F86EL(#T@,#L-"B`@("`@("`@1DE,151)344_at_8W)E871I
M;VX@/2![(#`@?0T*("`@("`@("`@("`@("`@+"!E>&ET("`@("`]('L@,"!]
M.R`O+R!"3T]35%](05-?1E1)344_/R`M9W!S#0H-"B`@("`@("`@:68@*&9A
M:6P@/3T_at_1V5T4')O8V5S<U1I;65S*$=E=$-U<G)E;G10<F]C97-S*"D-"B`@
M("`@("`@("`@("`@+"`F(&-R96%T:6]N+"`F(&5X:70-"B`@("`@("`@("`@
M("`@+"`F(')E:6YT97)P<F5T7V-A<W0\1DE,151)344F/BAK97)N96PI#0H@
M("`@("`@("`@("`@("P@)B!R96EN=&5R<')E=%]C87-T/$9)3$5424U%)CXH
M=7-E<BDI#0H@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@86UO=6YT7W1Y<&4@=3L-"@T*("`@(')E=')I979E*&LL('4I.PT*
M("`@(`T*("`@("\O(&=P<R!I9VYO<F4@:V5R;F5L('1I;64_#0H@("`@8V]N
M<W0@:6YT(&8@/2`Q,#L@+R\@8V]N=F5R<VEO;B!F86-T;W(Z(%=I;C,R('5S
M97,@,3`P(&YS('1I8VMS#0H@("`@<F5T=7)N(&UI8W)O<V5C;VYD<R_at_H=2`M
M('1H:7,M/G5S97)?=&EM92D@+R!F*0T*("`@("`@("`K(&UI8W)O<V5C;VYD
F<R_at_H:R`M('1H:7,M/FME<FYE;%]T:6UE*2`O(&8I.PT*?0T*#0IO
`
end
begin 644 example.cpp
M+R\@;&]W+6QE=F5L('1I;65R<R!E>&%M<&QE#0H-"@T*(VEN8VQU9&4@/&]S
M=')E86T^#0HC:6YC;'5D92`\:6]S=')E86T^#0H-"B-I;F-L=61E(")B;V]S
M="]D>6YA;6EC7V)I='-E="]D>6YA;6EC7V)I='-E="YH<'`B#0H-"B-I;F-L
M=61E(")L;W=?;&5V96Q?=&EM97)S+FAP<"(-"B-I;F-L=61E(")B;V]S="]C
M;VYF:6<N:'!P(@T*#0H-"B`@("\O(&=P<R`M('=O<G1H(&EN8VQU9&EN9R!T
M:&ES/PT*("`@+R\@("`@("`@97AP;W-I;F<@<&%U<V4H*2]R97-U;64H*2!I
M<R!E<G)O<BUP<F]N92!T;R!M90T*("`@('1E;7!L871E(#QT>7!E;F%M92!4
M/@T*("`@(&-L87-S('!A=7-E<B![#0H@("`@("`@(%0@)B!R968[#0H@("`@
M<'5B;&EC._at_T*("`@("`@("!P875S97(H5"8@<BD_at_.B!R968H<BD@>R!R968N
M<&%U<V4H*3L@?0T*("`@("`@("!^<&%U<V5R*"D@>R!R968N<F5S=6UE*"D[
M('T-"B`@("!].PT*#0IT96UP;&%T92`\='EP96YA;64_at_5&EM97(^#0IC;&%S
M<R!%>&%M<&QE#0I[#0H-"B`@("!S=&%T:6,@=F]I9"!M>5]S;&5E<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8VES:6]N.B`B(#P\(&-?8VQO8VM?<')E8VES:6]N*"D@/#P@
2)UQN)SL-"@T*?0T*#0H-"@T*
`
end

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk