Re: Negative durations

2016-03-16 Thread Benjamin Mahler
On Fri, Mar 11, 2016 at 9:22 AM, haosdent wrote: > I saw we use Seconds(-1) represent infinity in current code. > > ``` > ./3rdparty/libprocess/include/process/future.hpp: bool await(const > Duration& duration = Seconds(-1)) const; >

Re: Negative durations

2016-03-11 Thread haosdent
I saw we use Seconds(-1) represent infinity in current code. ``` ./3rdparty/libprocess/include/process/future.hpp: bool await(const Duration& duration = Seconds(-1)) const; ./3rdparty/libprocess/include/process/latch.hpp: bool await(const Duration& duration = Seconds(-1));

Re: Negative durations

2016-03-10 Thread Joris Van Remoortere
Duration and TimePoint were introduced to map to the types in C++ ( http://en.cppreference.com/w/cpp/chrono). Duration is negative so as not to surprise users when they do TimePoints A - B and end up with a positive duration when B > A. You could imagine a user of these writing code to check if

Re: Negative durations

2016-03-09 Thread Alexander Rojas
IMO durations should not be negative. The problem with having them define an infinite period is the following: Lets say you want to compute the duration between two durations A and B: C = A-B; if A < B, C is negative and it will be infinite. I one want’s to check for the case mentioned in [1]

Re: Negative durations

2016-03-09 Thread Klaus Ma
One case I can image is to use negative value for forever duration? Da (Klaus), Ma (马达) | PMP® | Advisory Software Engineer Platform OpenSource Technology, STG, IBM GCG +86-10-8245 4084 | klaus1982...@gmail.com | http://k82.me On Wed, Mar 9, 2016 at 8:21 PM, Alex Rukletsov

Negative durations

2016-03-09 Thread Alex Rukletsov
Folks, I've recently realized that durations we use in mesos (stout's `Duration` and `DurationInfo` protobuf) are based on signed integers. Negative duration concept is a bit strange to me, so I googled around a bit and found an interesting thread [1]. Was it an explicit intention to allow

Re: Review Request 11331: Improved Duration operator to 1) handle negative durations; 2) try to find a whole number to print out.

2013-10-23 Thread Vinod Kone
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/11331/#review27432 --- Can we get this committed? - Vinod Kone On Sept. 26, 2013, 5:58

Re: Review Request 11331: Improved Duration operator to 1) handle negative durations; 2) try to find a whole number to print out.

2013-09-25 Thread Ben Mahler
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/11331/#review26388 --- Ship it!

Re: Review Request 11331: Improved Duration operator to 1) handle negative durations; 2) try to find a whole number to print out.

2013-09-24 Thread Jiang Yan Xu
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/11331/ --- (Updated Sept. 24, 2013, 6:11 p.m.) Review request for mesos, Benjamin

Re: Review Request 11331: Improved Duration operator to 1) handle negative durations; 2) try to find a whole number to print out.

2013-09-23 Thread Ben Mahler
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/11331/#review26318 --- 3rdparty/libprocess/3rdparty/stout/include/stout/duration.hpp

Re: Review Request 11331: Improved Duration operator to 1) handle negative durations; 2) try to find a whole number to print out.

2013-09-23 Thread Jiang Yan Xu
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/11331/ --- (Updated Sept. 23, 2013, 9:28 p.m.) Review request for mesos, Benjamin

Re: Review Request 11331: Improved Duration operator to 1) handle negative durations; 2) try to find a whole number to print out.

2013-09-23 Thread Jiang Yan Xu
On Sept. 23, 2013, 11:04 p.m., Ben Mahler wrote: 3rdparty/libprocess/3rdparty/stout/include/stout/duration.hpp, lines 286-287 https://reviews.apache.org/r/11331/diff/4/?file=356211#file356211line286 What about making this class a friend of Duration (to gain access to the

Re: Review Request 11331: Improved Duration operator to 1) handle negative durations; 2) try to find a whole number to print out.

2013-09-23 Thread Ben Mahler
On Sept. 23, 2013, 11:04 p.m., Ben Mahler wrote: 3rdparty/libprocess/3rdparty/stout/include/stout/duration.hpp, lines 286-287 https://reviews.apache.org/r/11331/diff/4/?file=356211#file356211line286 What about making this class a friend of Duration (to gain access to the

Re: Review Request 11331: Improved Duration operator to 1) handle negative durations; 2) try to find a whole number to print out.

2013-08-26 Thread Jiang Yan Xu
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/11331/ --- (Updated Aug. 26, 2013, 6:09 p.m.) Review request for mesos, Benjamin Hindman,

Re: Review Request 11331: Improved Duration operator to 1) handle negative durations; 2) try to find a whole number to print out.

2013-08-26 Thread Ben Mahler
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/11331/#review25589 --- Ship it! Ship It! - Ben Mahler On Aug. 26, 2013, 6:09 p.m.,

Re: Review Request 11331: Improved Duration operator to 1) handle negative durations; 2) try to find a whole number to print out.

2013-08-15 Thread Jiang Yan Xu
On June 6, 2013, 9:46 p.m., Ben Mahler wrote: third_party/libprocess/third_party/stout/include/stout/duration.hpp, lines 268-281 https://reviews.apache.org/r/11331/diff/1/?file=295514#file295514line268 Well.. depends how one defines elegance, I had a hard time following this

Re: Review Request 11331: Improved Duration operator to 1) handle negative durations; 2) try to find a whole number to print out.

2013-08-15 Thread Jiang Yan Xu
--- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/11331/ --- (Updated Aug. 15, 2013, 8:39 p.m.) Review request for mesos, Benjamin Hindman,