[boost] [chrono] v0.4.1 + thread_clock implementation on Windows

Hi all, As suggested by Roland Bock on the Boost Users ML, I have implemented the thread_clock on Windows using FILETIME creationTime, exitTime, kernelTime, userTime; GetThreadTimes(GetCurrentThread (), &creationTime, &exitTime, &kernelTime,&userTime); I don't know Windows well, it would be very kind if someone of you can inspect the implementation. The implementation of thread_clock for Mac is still missing. I don't know even if thread cloks are provided on this platform. In addition, I have added also the function prototypes to Boost.Thread using Boost.Chrono as well as updated the tests. This could be used as a base for a possible Boost.Thread update using chrono (standard C++0x proposal), if the library is accepted, of course. Note the modifications of Boost.Thread have been done on the base of 1.43. The library can be downloaded from http://www.boostpro.com/vault/index.php?action=downloadfile&filename=chrono.... and the documentation is online on the sandbox http://svn.boost.org/svn/boost/sandbox/chrono/libs/chrono/doc/html/index.htm.... Anthony Williams has accepted to manage the review. We have not yet fixed a date, but I expect we could communicate one soon. I will be very thankful, if people using the library already or that could be interested in, can do a review even before the date. Thanks, _____________________ Vicente Juan Botet Escribá http://viboes.blogspot.com/

Hi, I've been playing with chrono a few. The stopwtach is actually pretty straightforward to use :) I got one question: why not make ratio a real MPL arithmetic types so we can actually use MPL algorithms on MPL vector of ratio or to have ratio_add becoming mpl::plus ?

----- Original Message ----- From: "joel falcou" <joel.falcou@lri.fr> To: <boost-users@lists.boost.org> Sent: Thursday, June 17, 2010 7:20 AM Subject: Re: [Boost-users] [boost] [chrono] v0.4.1 + thread_clock implementation on Windows
Hi,
I've been playing with chrono a few. The stopwtach is actually pretty straightforward to use :)
This was the goal :)
I got one question: why not make ratio a real MPL arithmetic types so we can actually use MPL algorithms on MPL vector of ratio or to have ratio_add becoming mpl::plus ?
Hi Joel, What do you mean by a "real MPL arithmetic types " I'm aware of mpl integral constants, but I don't know other that can be used as arithmetic constants. What a re the requirements for these MPL arithmetic types? Could you elaborate? Best, Vicente

vicente.botet wrote:
What do you mean by a "real MPL arithmetic types " I'm aware of mpl integral constants, but I don't know other that can be used as arithmetic constants. What a re the requirements for these MPL arithmetic types? Could you elaborate?
MPL arithmetic types should model the MPL Integral Constant concepts as specified here: http://www.boost.org/doc/libs/1_43_0/libs/mpl/doc/refmanual/integral-constan... the idea is just to have your rational type being usable like: boost::mpl::plus<R1,R2>::type instead of using ratio_plus etc...

----- Original Message ----- From: "joel falcou" <joel.falcou@lri.fr> To: <boost-users@lists.boost.org> Sent: Sunday, June 20, 2010 12:10 PM Subject: Re: [Boost-users] [boost] [chrono] v0.4.1 + thread_clock implementation on Windows
vicente.botet wrote:
What do you mean by a "real MPL arithmetic types " I'm aware of mpl integral constants, but I don't know other that can be used as arithmetic constants. What a re the requirements for these MPL arithmetic types? Could you elaborate?
MPL arithmetic types should model the MPL Integral Constant concepts as specified here:
http://www.boost.org/doc/libs/1_43_0/libs/mpl/doc/refmanual/integral-constan...
the idea is just to have your rational type being usable like:
boost::mpl::plus<R1,R2>::type
instead of using ratio_plus etc...
Joel, arithmetic and integral are not the same thing for me. I don't see how I can make ratio be a model of a MPL Integral constant as ratio is not integral, value_type can not be defined, there is no next, nor prior. Am I missing something? Are you suggesting that I write an specialization of boost::mpl::plus for ratio? Thanks, Vicente

vicente.botet wrote:
Joel, arithmetic and integral are not the same thing for me. I don't see how I can make ratio be a model of a MPL Integral constant as ratio is not integral, value_type can not be defined, there is no next, nor prior. Am I missing something?
I'm fully aware of that, I was more suggesting that, yes, mpl::plus and etc works on ratio. Let's call that a Rational Constant then ;) The alternative is to just rename ratio_plus to plus.

----- Original Message ----- From: "joel falcou" <joel.falcou@lri.fr> To: <boost-users@lists.boost.org> Sent: Sunday, June 20, 2010 1:58 PM Subject: Re: [Boost-users] [boost] [chrono] v0.4.1 + thread_clock implementation on Windows
vicente.botet wrote:
Joel, arithmetic and integral are not the same thing for me. I don't see how I can make ratio be a model of a MPL Integral constant as ratio is not integral, value_type can not be defined, there is no next, nor prior. Am I missing something?
I'm fully aware of that, I was more suggesting that, yes, mpl::plus and etc works on ratio.
Yes, this could be great. Are you suggesting to rename ration_plus to mpl::plus and require that the parameters are Rational Constants?
Let's call that a Rational Constant then ;)
What should be for you the requirements for a Rational Constant? Expression Type Complexity r::tag rational_c_tag Constant time. r::value_type A boost::rational<integral_type> type Constant time. r::num An integral constant expression Constant time. r::den An integral constant expression Constant time. r::type Rational Constant Constant time. r::value_type const c = r() Constant time. Expression Semantics r::tag r's tag type; n::tag::value is n's conversion rank. r::num The value of the numerator integral constant. r::den The value of the denominator integral constant. r::type is_equivalent<r::type,r>::value == true. r::value_type const c = r() c.numerator() * r::den == c.denominator() * r::num.
The alternative is to just rename ratio_plus to plus.
Boost.Chrono follows the C++0x namming. What would be the advantage of renaming it? Best, Vicente

vicente.botet wrote:
What should be for you the requirements for a Rational Constant?
Expression Type Complexity r::tag rational_c_tag Constant time. r::value_type A boost::rational<integral_type> type Constant time. r::num An integral constant expression Constant time. r::den An integral constant expression Constant time. r::type Rational Constant Constant time. r::value_type const c = r() Constant time.
Expression Semantics r::tag r's tag type; n::tag::value is n's conversion rank. r::num The value of the numerator integral constant. r::den The value of the denominator integral constant. r::type is_equivalent<r::type,r>::value == true. r::value_type const c = r() c.numerator() * r::den == c.denominator() * r::num.
make sense I think
Boost.Chrono follows the C++0x namming. What would be the advantage of renaming it?
OK then
participants (2)
-
joel falcou
-
vicente.botet