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



src/linux/cgroups.cpp
<https://reviews.apache.org/r/5395/#comment18411>

    No need to make this public, you can keep it protected.



src/linux/cgroups.cpp
<https://reviews.apache.org/r/5395/#comment18408>

    You should put all of the 'start' logic into 'initialize' and all of the 
'stop' logic into 'finalize'. Then just pass a "lambda" to terminate self when 
the future is discarded (a few lines above).



src/linux/cgroups.cpp
<https://reviews.apache.org/r/5395/#comment18410>

    Just 'terminate(self())' after putting the logic into finalize.



src/linux/cgroups.cpp
<https://reviews.apache.org/r/5395/#comment18403>

    sizeof(data)



src/linux/cgroups.cpp
<https://reviews.apache.org/r/5395/#comment18402>

    Kill newline.



src/linux/cgroups.cpp
<https://reviews.apache.org/r/5395/#comment18405>

    Why not just return Future?



src/linux/cgroups.cpp
<https://reviews.apache.org/r/5395/#comment18406>

    You can set Future.failed here.



src/linux/cgroups.cpp
<https://reviews.apache.org/r/5395/#comment18404>

    While unlikely to be exposed, there is actually a race here ... it's 
possible listener has been garbage collected before doing 'listener->future()'.
    
    Two options: Pull the future out before you spawn, or just pass a promise 
(allocated on the heap) into the process.


- Benjamin Hindman


On June 28, 2012, 7:40 p.m., Jie Yu wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/5395/
> -----------------------------------------------------------
> 
> (Updated June 28, 2012, 7:40 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Vinod Kone.
> 
> 
> Description
> -------
> 
> In cgroups, sometimes you want to be notified if some certain events happen. 
> For example, users may want to be notified when an out-of-memory event 
> happens.
> 
> This patch introduce a function called "listenEvent" which returns an 
> instance of Future so that you can check the status of this future to see 
> whether any event happens.
> 
> This interface is general to all the events in cgroups.
> 
> 
> Diffs
> -----
> 
>   src/linux/cgroups.hpp PRE-CREATION 
>   src/linux/cgroups.cpp PRE-CREATION 
>   src/tests/cgroups_tests.cpp PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/5395/diff/
> 
> 
> Testing
> -------
> 
> On Linux machines, make check.
> 
> 
> Thanks,
> 
> Jie Yu
> 
>

Reply via email to