<HTML xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<HEAD><!-- Template generated by Exclaimer Mail Disclaimers on 04:23:03 Tuesday, 2 October 2012 -->
<STYLE type=text/css>P.cd90c476-0d91-4d15-b60e-a1073efa726c {
        MARGIN: 0cm 0cm 0pt
}
LI.cd90c476-0d91-4d15-b60e-a1073efa726c {
        MARGIN: 0cm 0cm 0pt
}
DIV.cd90c476-0d91-4d15-b60e-a1073efa726c {
        MARGIN: 0cm 0cm 0pt
}
TABLE.cd90c476-0d91-4d15-b60e-a1073efa726cTable {
        MARGIN: 0cm 0cm 0pt
}
DIV.Section1 {
        page: Section1
}
</STYLE>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Generator" content="Microsoft Word 14 (filtered medium)" />
<style><!--
/* Font Definitions */
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</HEAD>

<BODY lang="EN-US" link="blue" vlink="purple">
<P class=cd90c476-0d91-4d15-b60e-a1073efa726c>
<div class="WordSection1">
<p class="MsoNormal"><span style=font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D>Hello Baruch,<o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D><o:p> </o:p></span></p>
<p class="MsoNormal"><span style=font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D>thanks for your comment.<o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D>OK, I’ll just aim to create an implementation of all-purpose<o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D>portable clock with the possibility of monotonic/ real-time<o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D>operation (where available).<o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D>It still should be encapsulated, though.  Unlike time() and<o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D>difftime(), clock_*time() interface (or at least the monotonic<o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D>clock back-end) is not available everywhere.<o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D>If we want real portability, we need our own opaque type<o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D>and encapsulation of the implementation.<o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D><o:p> </o:p></span></p>
<p class="MsoNormal"><span style=font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D>I guess I’ll just code a proposition and we shall se...<o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D><o:p> </o:p></span></p>
<p class="MsoNormal"><span style=font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D>Regards,<o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D><o:p> </o:p></span></p>
<p class="MsoNormal"><span style=font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D>Vaclav<o:p></o:p></span></p>
<p class="MsoNormal"><span style=font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D><o:p> </o:p></span></p>
<p class="MsoNormal"><span style=font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D><o:p> </o:p></span></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
</div></div></div></P>
<P class=cd90c476-0d91-4d15-b60e-a1073efa726c> </P>
<P class=cd90c476-0d91-4d15-b60e-a1073efa726c>
<HR id=HR1 />
Eaton Elektrotechnika s.r.o. ~ S�dlo spolecnosti, jak je zaps�no v rejstr�ku: Kom�rovsk� 2406, Praha 9 - Horn� Pocernice, 193 00, Cesk� Republika ~ Jm�no, m�sto, kde byla spolecnost zaregistrov�na: Praha ~ Identifikacn� c�slo (ICO): 498 11 894 
<P class=cd90c476-0d91-4d15-b60e-a1073efa726c>
<HR id=HR1 />

<P></P>
<P class=cd90c476-0d91-4d15-b60e-a1073efa726c> </P>
<P class=cd90c476-0d91-4d15-b60e-a1073efa726c><div class="WordSection1"><div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt"><div><div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span style=font-size:10.0pt;font-family:"Tahoma","sans-serif">From:</span></b><span style=font-size:10.0pt;font-family:"Tahoma","sans-serif"> Baruch Even [mailto:baruch@ev-en.org]
<br />
<b>Sent:</b> Thursday, September 27, 2012 2:26 PM<br />
<b>To:</b> Krpec, Vaclav<br />
<b>Cc:</b> aquette.dev@gmail.com; nut-upsdev@lists.alioth.debian.org; clepple@gmail.com; baruch@debian.org<br />
<b>Subject:</b> Re: [Nut-upsdev] NUT Bugs #313634 & #313714: unification & encapsulation of timer proposition<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p>My opinion on this is that it might be a little too abstract. I'd go with what I essentially started which is to abstract just a monotonic clock with only what is needed. If the platform doesn't have a monitonic clock than it can be apprixmated.<o:p></o:p></p>
<p>This will also serve to explain the real intention of a monotonic clock and not just a plain timer.<o:p></o:p></p>
<p>My 2¢<o:p></o:p></p>
<p>Baruch<o:p></o:p></p>
<div>
<p class="MsoNormal">On Sep 27, 2012 1:19 PM, <<a href="mailto:VaclavKrpec@eaton.com">VaclavKrpec@eaton.com</a>> wrote:<o:p></o:p></p>
<p class="MsoNormal">Hello everybody,<br />
<br />
I'm working on the "Use difftime for time comparison" bug (#313634).<br />
Charles directed me to the other one "Use monotonic clock for monitoring"<br />
attended to by Baruch; I believe that's very good idea, however I'd use a bit<br />
more encapsulated & general approach:<br />
<br />
1/ I'd create an opaque timer type and its get/set/cmp/inc/dec etc interface<br />
under common<br />
2/ implementation of the interface would use the monotonic clock if available<br />
(the clock_*time on Linux, potentially other monotonic clock impl. on other<br />
systems) and time_t as a fallback<br />
3/ when implemented, use of the timer shall be spread throughout the code,<br />
replacing direct use of time_t<br />
<br />
What do you think?<br />
I'm also a bit reluptant to do such a change in scope of the bugfix; I'd create<br />
a new feature req. for that, OK?<br />
<br />
Any comments/ suggestions welcome,<br />
<br />
Regards,<br />
<br />
Vaclav<br />
<br />
P.S: already managed to post this from another address by mistake, so please<br />
just discard the previous e-mail (or this one, depending on which you've read).<br />
<br />
--<br />
Václav Krpec<br />
Software Developer<br />
Network UPS Tools project<br />
Eaton Opensource Team<br />
Eaton European Innovation Center<br />
<br />
<br />
<br />
<br />
-----------------------------<br />
Eaton Elektrotechnika s.r.o. ~ S<span style=font-family:"Tahoma","sans-serif">�</span>dlo spolecnosti, jak je zaps<span style=font-family:"Tahoma","sans-serif">�</span>no v rejstr<span style=font-family:"Tahoma","sans-serif">�</span>ku: Kom<span style=font-family:"Tahoma","sans-serif">�</span>rovsk<span style=font-family:"Tahoma","sans-serif">�</span>
 2406, Praha 9 - Horn<span style=font-family:"Tahoma","sans-serif">�</span> Pocernice, 193 00, Cesk<span style=font-family:"Tahoma","sans-serif">�</span> Republika ~ Jm<span style=font-family:"Tahoma","sans-serif">�</span>no, m<span style=font-family:"Tahoma","sans-serif">�</span>sto,
 kde byla spolecnost zaregistrov<span style=font-family:"Tahoma","sans-serif">�</span>na: Praha ~ Identifikacn<span style=font-family:"Tahoma","sans-serif">�</span> c<span style=font-family:"Tahoma","sans-serif">�</span>slo (ICO): 498 11 894<br />
-----------------------------<br />
<br />
<br />
_______________________________________________<br />
Nut-upsdev mailing list<br />
<a href="mailto:Nut-upsdev@lists.alioth.debian.org">Nut-upsdev@lists.alioth.debian.org</a><br />
<a href="http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev" target="_blank">http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsdev</a><o:p></o:p></p>
</div>
</div>
</div>
</P></P></P></BODY>
</HTML>