-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/39949/#review105115
-----------------------------------------------------------


Can we test that more thoroughly than just "make check"? e.g., if there's a 
unit test that tries to enter this logic with multiple threads at once, running 
that with gtest_repeat=1000 would be nice.


3rdparty/libprocess/src/process.cpp (line 742)
<https://reviews.apache.org/r/39949/#comment163522>

    I wonder if it would be an improvement to rename these variables to reflect 
what they are used for more clearly.
    
    For example: maybe call them "initialize_started" and "initialize_complete" 
(and change the second so that it goes from false -> true instead of true -> 
false).



3rdparty/libprocess/src/process.cpp (line 751)
<https://reviews.apache.org/r/39949/#comment163523>

    process::initialize.



3rdparty/libprocess/src/process.cpp (line 759)
<https://reviews.apache.org/r/39949/#comment163521>

    Can you clarify what "the first ones" means here?


Can

- Neil Conway


On Nov. 4, 2015, 6:58 p.m., Joseph Wu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/39949/
> -----------------------------------------------------------
> 
> (Updated Nov. 4, 2015, 6:58 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Joris Van Remoortere.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> The initialization synchronization logic contains three conditions, which 
> check:
> 1) Was `initialize` called and is it done?
> 2) Was `initialize` called and is it not done?
> 3) Are you the first to call `initialize`?
> 
> Condition (3) uses `compare_exchange_strong` between `initialized` and 
> `false`.  This returns `true` (and sets `initialized` to true) iff the caller 
> is the first to reach that expression.
> 
> The second simultaneous caller of `initialize` will either satisify condition 
> (2) or (3) and then wait on `initializing`.  For the second caller, (2) and 
> (3) are identical because `compare_exchange_strong` between `true` and 
> `false` will always return false, thereby putting the second caller into the 
> waiting loop.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/src/process.cpp 
> a94712b9ac3b60fb047b3a5a4d84a56fa4d02313 
> 
> Diff: https://reviews.apache.org/r/39949/diff/
> 
> 
> Testing
> -------
> 
> `make check`
> 
> 
> Thanks,
> 
> Joseph Wu
> 
>

Reply via email to