> 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. > > Zuyu Zhang wrote: > We do need to protect any shared variables in LowLevelScheduler using > scheduler::Mesos, which internally uses process::async() to execute callbacks.
For correctness, we only need to protect shared variables accessed by both the main thread and scheduler::Mesos. In this case, state and framework. - Zuyu ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/23216/#review47220 ----------------------------------------------------------- On July 3, 2014, 10:02 p.m., Zuyu Zhang wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/23216/ > ----------------------------------------------------------- > > (Updated July 3, 2014, 10:02 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 6306b319638843e4808b4677bca0479075dfaa9f > 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 > >
