> On July 2, 2014, 11:38 p.m., Vinod Kone wrote:
> > src/examples/low_level_scheduler_pthread.cpp, line 119
> > <https://reviews.apache.org/r/23216/diff/1/?file=622210#file622210line119>
> >
> >     do we need to protect this via mutex? afaict, all the callbacks 
> > (connected, detected and received) are already synchronized by Mesos.

We do need to protect any shared variables in LowLevelScheduler using 
scheduler::Mesos, which internally uses process::async() to execute callbacks.


> On July 2, 2014, 11:38 p.m., Vinod Kone wrote:
> > src/examples/low_level_scheduler_pthread.cpp, line 134
> > <https://reviews.apache.org/r/23216/diff/1/?file=622210#file622210line134>
> >
> >     ditto. here.

See above.


> On July 2, 2014, 11:38 p.m., Vinod Kone wrote:
> > src/examples/low_level_scheduler_pthread.cpp, line 149
> > <https://reviews.apache.org/r/23216/diff/1/?file=622210#file622210line149>
> >
> >     ditto.

ditto.


> On July 2, 2014, 11:38 p.m., Vinod Kone wrote:
> > src/examples/low_level_scheduler_pthread.cpp, line 350
> > <https://reviews.apache.org/r/23216/diff/1/?file=622210#file622210line350>
> >
> >     This method name is misleading because it is not actually doing 
> > reliable registration. It is just sending a registration request once. Some 
> > other method (wait()) is orchestrating the reliable part.
> >     
> >     It is probably cleaner to move the while loop from wait() to here to do 
> > reliable registration. Is there a reason why wait() needs a while loop?

wait() does need a while loop to keep waiting until all the tasks are done. 
Another reason to use the loop is for reliability. If the scheduler disconnects 
from the master for any reasons (e.g., machine failures, network partition), it 
could survive by re-registration. On the other hand, the libprocess version 
does the same thing through doReliableRegistration().

Therefore, how about s/doReliableRegistration/doRegistration?


- Zuyu


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


On July 1, 2014, 11:05 p.m., Zuyu Zhang wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/23216/
> -----------------------------------------------------------
> 
> (Updated July 1, 2014, 11:05 p.m.)
> 
> 
> Review request for mesos, Benjamin Hindman, Ben Mahler, and Vinod Kone.
> 
> 
> Repository: mesos-git
> 
> 
> Description
> -------
> 
> Added the low level scheduler example using pthread.
> 
> 
> Diffs
> -----
> 
>   src/Makefile.am e3ff6d71d9324ea8376c14fae056568452f22bdc 
>   src/examples/low_level_scheduler_pthread.cpp PRE-CREATION 
>   src/tests/examples_tests.cpp 2b554d72f0058a68f589719373f3d3e37a3a7ba3 
>   src/tests/low_level_scheduler_pthread_test.sh PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/23216/diff/
> 
> 
> Testing
> -------
> 
> [==========] Running 1 test from 1 test case.
> [----------] Global test environment set-up.
> [----------] 1 test from ExamplesTest
> [ RUN      ] ExamplesTest.LowLevelSchedulerPthread
> [       OK ] ExamplesTest.LowLevelSchedulerPthread (1655 ms)
> [----------] 1 test from ExamplesTest (1655 ms total)
> 
> [----------] Global test environment tear-down
> [==========] 1 test from 1 test case ran. (1669 ms total)
> [  PASSED  ] 1 test.
> 
> 
> Thanks,
> 
> Zuyu Zhang
> 
>

Reply via email to