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

Ship it!


At the risk of sounding unsatisfiable, I'd like to suggest an os::pids 
overload, i.e., os::pids(const Option<pid_t>& group, const Option<pid_t>& 
session). Then users could do 'os::pids(group, None())' to get all pids of a 
particular group or 'os::pids(None(), session)' to get all pids of a particular 
session or os::pids(group, session) to get all pids of a particular group with 
a particular session (which is strictly more functionality). This overload acts 
like a "filter" for pids, which is how I'd want to implement this if I had 
lambdas and a higher-order "map" function (i.e., os::pids().map([] (pid_t pid) 
{ if (os::process(pid).get().session == session) { return pid; } else { None(); 
} }). I recognize the downside here is that 'group' and 'session' are both just 
pid_t types and so someone might mix them up (where os::group and os::session 
is more explicit).


3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
<https://reviews.apache.org/r/11847/#comment45261>

    Please put '{' on newline.



3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
<https://reviews.apache.org/r/11847/#comment45263>

    I'd also be okay with the semantics that a group < 0 just returns an empty 
set (because 'process.group == group' will never be true right?).



3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp
<https://reviews.apache.org/r/11847/#comment45262>

    Please put '{' on newline.



3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp
<https://reviews.apache.org/r/11847/#comment45264>

    To keep the constants first, maybe 'EXPECT_LE(1u, groupe.get().size())'?



3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp
<https://reviews.apache.org/r/11847/#comment45265>

    To keep the constants first, maybe 'EXPECT_LE(1u, groupe.get().size())'?


- Benjamin Hindman


On June 12, 2013, 7:44 p.m., Ben Mahler wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/11847/
> -----------------------------------------------------------
> 
> (Updated June 12, 2013, 7:44 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman and Vinod Kone.
> 
> 
> Description
> -------
> 
> This was particularly useful for my upcoming killtree change.
> 
> 
> Diffs
> -----
> 
>   3rdparty/libprocess/3rdparty/stout/include/stout/os.hpp 
> 1b3fb47d7567b5467fef2a2bb15d5c4a2ea42aa5 
>   3rdparty/libprocess/3rdparty/stout/tests/os_tests.cpp 
> 047778d05ebbbefd85e4a163dbb6ab8445edfb7f 
> 
> Diff: https://reviews.apache.org/r/11847/diff/
> 
> 
> Testing
> -------
> 
> Added basic tests for now. Benh and I were discussing creating a nice 
> abstraction for generating process trees that will make testing simpler.
> 
> 
> Thanks,
> 
> Ben Mahler
> 
>

Reply via email to