Re: Review Request 46395: Windows: Removed `std::bind` from `process.cpp` to build on Windows.

2016-05-11 Thread Michael Park

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


Ship it!




Ship It!

- Michael Park


On May 10, 2016, 8:08 a.m., Alex Clemmer wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46395/
> ---
> 
> (Updated May 10, 2016, 8:08 a.m.)
> 
> 
> Review request for mesos, Alex Naparu, Daniel Pravat, Artem Harutyunyan, 
> Joris Van Remoortere, Michael Park, M Lawindi, and Yi Sun.
> 
> 
> Bugs: MESOS-3637
> https://issues.apache.org/jira/browse/MESOS-3637
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Windows: Removed `std::bind` from `process.cpp` to build on Windows.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/src/process.cpp 
> 8727eb202e9699f0ac3c95788257cf1a22b0da7b 
> 
> Diff: https://reviews.apache.org/r/46395/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Alex Clemmer
> 
>



Re: Review Request 46395: Windows: Removed `std::bind` from `process.cpp` to build on Windows.

2016-05-05 Thread Michael Park


> On May 4, 2016, 10:53 p.m., Michael Park wrote:
> > 3rdparty/libprocess/src/process.cpp, lines 2240-2270
> > 
> >
> > Consider this if you would to preserve the guarantee:
> > 
> > ```cpp
> >   struct
> >   {
> > void operator()() const
> > {
> >   do {
> > ProcessBase* process = process_manager->dequeue();
> > if (process == NULL) {
> >   Gate::state_t old = gate->approach();
> >   process = process_manager->dequeue();
> >   if (process == NULL) {
> > if (joining_threads.load()) {
> >   break;
> > }
> > gate->arrive(old);
> > // Wait
> > // at
> > // gate
> > // if
> > // idle.
> > continue;
> >   } else {
> > gate->leave();
> >   }
> > }
> > process_manager->resume(process);
> >   } while (true);
> > }
> > 
> > // We hold a constant reference to `joining_threads` to make it 
> > clear that this
> > // value is only being tested (read), and not manipulated.
> > const std::atomic_bool& joining_threads;
> >   } worker{joining_threads};
> > 
> >   // Create processing threads.
> >   for (long i = 0; i < num_worker_threads; i++) {
> > // Retain the thread handles so that we can join when shutting down.
> > threads.emplace_back(new std::thread(worker));
> >   }
> > ```
> 
> Alex Clemmer wrote:
> I like this code, but I would feel odd submitting a review that is almost 
> entirely your code, and then taking credit for it in the commit log. It might 
> make sense to do a follow up?

Haha, don't worry about it. If you like to suggestion, please update this 
review and we'll commit it!

Just a note, it looks like I messed up the formatting in the suggestion:

```
gate->arrive(old);
// Wait
// at
// gate
// if
// idle.
```

should be:

```
gate->arrive(old); // Wait at gate if idle.
```


- Michael


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


On May 5, 2016, 3:55 p.m., Alex Clemmer wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46395/
> ---
> 
> (Updated May 5, 2016, 3:55 p.m.)
> 
> 
> Review request for mesos, Alex Naparu, Daniel Pravat, Artem Harutyunyan, 
> Joris Van Remoortere, Michael Park, M Lawindi, and Yi Sun.
> 
> 
> Bugs: MESOS-3637
> https://issues.apache.org/jira/browse/MESOS-3637
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Windows: Removed `std::bind` from `process.cpp` to build on Windows.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/src/process.cpp 
> 8727eb202e9699f0ac3c95788257cf1a22b0da7b 
> 
> Diff: https://reviews.apache.org/r/46395/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Alex Clemmer
> 
>



Re: Review Request 46395: Windows: Removed `std::bind` from `process.cpp` to build on Windows.

2016-05-05 Thread Alex Clemmer

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

(Updated May 5, 2016, 3:55 p.m.)


Review request for mesos, Alex Naparu, Daniel Pravat, Artem Harutyunyan, Joris 
Van Remoortere, Michael Park, M Lawindi, and Yi Sun.


Bugs: MESOS-3637
https://issues.apache.org/jira/browse/MESOS-3637


Repository: mesos


Description
---

Windows: Removed `std::bind` from `process.cpp` to build on Windows.


Diffs (updated)
-

  3rdparty/libprocess/src/process.cpp 8727eb202e9699f0ac3c95788257cf1a22b0da7b 

Diff: https://reviews.apache.org/r/46395/diff/


Testing
---


Thanks,

Alex Clemmer



Re: Review Request 46395: Windows: Removed `std::bind` from `process.cpp` to build on Windows.

2016-05-05 Thread Alex Clemmer


> On May 4, 2016, 10:53 p.m., Michael Park wrote:
> > 3rdparty/libprocess/src/process.cpp, lines 2240-2270
> > 
> >
> > Consider this if you would to preserve the guarantee:
> > 
> > ```cpp
> >   struct
> >   {
> > void operator()() const
> > {
> >   do {
> > ProcessBase* process = process_manager->dequeue();
> > if (process == NULL) {
> >   Gate::state_t old = gate->approach();
> >   process = process_manager->dequeue();
> >   if (process == NULL) {
> > if (joining_threads.load()) {
> >   break;
> > }
> > gate->arrive(old);
> > // Wait
> > // at
> > // gate
> > // if
> > // idle.
> > continue;
> >   } else {
> > gate->leave();
> >   }
> > }
> > process_manager->resume(process);
> >   } while (true);
> > }
> > 
> > // We hold a constant reference to `joining_threads` to make it 
> > clear that this
> > // value is only being tested (read), and not manipulated.
> > const std::atomic_bool& joining_threads;
> >   } worker{joining_threads};
> > 
> >   // Create processing threads.
> >   for (long i = 0; i < num_worker_threads; i++) {
> > // Retain the thread handles so that we can join when shutting down.
> > threads.emplace_back(new std::thread(worker));
> >   }
> > ```

I like this code, but I would feel odd submitting a review that is almost 
entirely your code, and then taking credit for it in the commit log. It might 
make sense to do a follow up?


- Alex


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


On May 5, 2016, 3:55 p.m., Alex Clemmer wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46395/
> ---
> 
> (Updated May 5, 2016, 3:55 p.m.)
> 
> 
> Review request for mesos, Alex Naparu, Daniel Pravat, Artem Harutyunyan, 
> Joris Van Remoortere, Michael Park, M Lawindi, and Yi Sun.
> 
> 
> Bugs: MESOS-3637
> https://issues.apache.org/jira/browse/MESOS-3637
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Windows: Removed `std::bind` from `process.cpp` to build on Windows.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/src/process.cpp 
> 8727eb202e9699f0ac3c95788257cf1a22b0da7b 
> 
> Diff: https://reviews.apache.org/r/46395/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Alex Clemmer
> 
>



Re: Review Request 46395: Windows: Removed `std::bind` from `process.cpp` to build on Windows.

2016-05-04 Thread Michael Park

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




3rdparty/libprocess/src/process.cpp (lines 896 - 897)


```cpp
  if (::setsockopt(
  __s__->get(),
  SOL_SOCKET,
  SO_REUSEADDR,
  reinterpret_cast(),
  sizeof(on)) < 0) {
```



3rdparty/libprocess/src/process.cpp (lines 2240 - 2269)


Consider this if you would to preserve the guarantee:

```cpp
  struct
  {
void operator()() const
{
  do {
ProcessBase* process = process_manager->dequeue();
if (process == NULL) {
  Gate::state_t old = gate->approach();
  process = process_manager->dequeue();
  if (process == NULL) {
if (joining_threads.load()) {
  break;
}
gate->arrive(old);
// Wait
// at
// gate
// if
// idle.
continue;
  } else {
gate->leave();
  }
}
process_manager->resume(process);
  } while (true);
}

// We hold a constant reference to `joining_threads` to make it clear 
that this
// value is only being tested (read), and not manipulated.
const std::atomic_bool& joining_threads;
  } worker{joining_threads};

  // Create processing threads.
  for (long i = 0; i < num_worker_threads; i++) {
// Retain the thread handles so that we can join when shutting down.
threads.emplace_back(new std::thread(worker));
  }
```


- Michael Park


On April 23, 2016, 11:26 p.m., Alex Clemmer wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46395/
> ---
> 
> (Updated April 23, 2016, 11:26 p.m.)
> 
> 
> Review request for mesos, Alex Naparu, Daniel Pravat, Artem Harutyunyan, 
> Joris Van Remoortere, Michael Park, M Lawindi, and Yi Sun.
> 
> 
> Bugs: MESOS-3637
> https://issues.apache.org/jira/browse/MESOS-3637
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Windows: Removed `std::bind` from `process.cpp` to build on Windows.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/src/process.cpp 
> 8727eb202e9699f0ac3c95788257cf1a22b0da7b 
> 
> Diff: https://reviews.apache.org/r/46395/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Alex Clemmer
> 
>



Re: Review Request 46395: Windows: Removed `std::bind` from `process.cpp` to build on Windows.

2016-04-23 Thread Alex Clemmer

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

(Updated April 23, 2016, 11:26 p.m.)


Review request for mesos, Alex Naparu, Daniel Pravat, Artem Harutyunyan, Joris 
Van Remoortere, Michael Park, M Lawindi, and Yi Sun.


Bugs: MESOS-3637
https://issues.apache.org/jira/browse/MESOS-3637


Repository: mesos


Description
---

Windows: Removed `std::bind` from `process.cpp` to build on Windows.


Diffs (updated)
-

  3rdparty/libprocess/src/process.cpp 8727eb202e9699f0ac3c95788257cf1a22b0da7b 

Diff: https://reviews.apache.org/r/46395/diff/


Testing
---


Thanks,

Alex Clemmer



Re: Review Request 46395: Windows: Removed `std::bind` from `process.cpp` to build on Windows.

2016-04-23 Thread Alex Clemmer


> On April 22, 2016, 10:04 p.m., Joris Van Remoortere wrote:
> > 3rdparty/libprocess/src/process.cpp, line 897
> > 
> >
> > space between `(char*)` and ``

Let's actually make it a C++ cast.


- Alex


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


On April 19, 2016, 4:35 p.m., Alex Clemmer wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46395/
> ---
> 
> (Updated April 19, 2016, 4:35 p.m.)
> 
> 
> Review request for mesos, Alex Naparu, Daniel Pravat, Artem Harutyunyan, 
> Joris Van Remoortere, Michael Park, M Lawindi, and Yi Sun.
> 
> 
> Bugs: MESOS-3637
> https://issues.apache.org/jira/browse/MESOS-3637
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Windows: Removed `std::bind` from `process.cpp` to build on Windows.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/src/process.cpp 
> d2c458ed93307f75358bb642aaf2ed8e17b2fe97 
> 
> Diff: https://reviews.apache.org/r/46395/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Alex Clemmer
> 
>



Re: Review Request 46395: Windows: Removed `std::bind` from `process.cpp` to build on Windows.

2016-04-22 Thread Joris Van Remoortere

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


Fix it, then Ship it!





3rdparty/libprocess/src/process.cpp (lines 13 - 40)


Please leave these in the original order and use the smaller `#ifndef 
__WINDOWS__` blocks where needed. I think the 3? places necessary are still 
clean enough to keep the original ordering.



3rdparty/libprocess/src/process.cpp (line 888)


space between `(char*)` and ``


- Joris Van Remoortere


On April 19, 2016, 4:35 p.m., Alex Clemmer wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46395/
> ---
> 
> (Updated April 19, 2016, 4:35 p.m.)
> 
> 
> Review request for mesos, Alex Naparu, Daniel Pravat, Artem Harutyunyan, 
> Joris Van Remoortere, Michael Park, M Lawindi, and Yi Sun.
> 
> 
> Bugs: MESOS-3637
> https://issues.apache.org/jira/browse/MESOS-3637
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Windows: Removed `std::bind` from `process.cpp` to build on Windows.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/src/process.cpp 
> d2c458ed93307f75358bb642aaf2ed8e17b2fe97 
> 
> Diff: https://reviews.apache.org/r/46395/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Alex Clemmer
> 
>



Re: Review Request 46395: Windows: Removed `std::bind` from `process.cpp` to build on Windows.

2016-04-19 Thread Mesos ReviewBot

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



Patch looks great!

Reviews applied: [46393, 46395]

Passed command: export OS='ubuntu:14.04' CONFIGURATION='--verbose' 
COMPILER='gcc' ENVIRONMENT='GLOG_v=1 MESOS_VERBOSE=1'; ./support/docker_build.sh

- Mesos ReviewBot


On April 19, 2016, 4:35 p.m., Alex Clemmer wrote:
> 
> ---
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/46395/
> ---
> 
> (Updated April 19, 2016, 4:35 p.m.)
> 
> 
> Review request for mesos, Alex Naparu, Daniel Pravat, Artem Harutyunyan, 
> Joris Van Remoortere, Michael Park, M Lawindi, and Yi Sun.
> 
> 
> Bugs: MESOS-3637
> https://issues.apache.org/jira/browse/MESOS-3637
> 
> 
> Repository: mesos
> 
> 
> Description
> ---
> 
> Windows: Removed `std::bind` from `process.cpp` to build on Windows.
> 
> 
> Diffs
> -
> 
>   3rdparty/libprocess/src/process.cpp 
> d2c458ed93307f75358bb642aaf2ed8e17b2fe97 
> 
> Diff: https://reviews.apache.org/r/46395/diff/
> 
> 
> Testing
> ---
> 
> 
> Thanks,
> 
> Alex Clemmer
> 
>