You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2017/08/01 21:03:01 UTC

[03/16] mesos git commit: Minor clean ups for run queue.

Minor clean ups for run queue.


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/fb9f0e78
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/fb9f0e78
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/fb9f0e78

Branch: refs/heads/master
Commit: fb9f0e785975f13e0e6bb7a80274868b5c300a16
Parents: f863a22
Author: Benjamin Hindman <be...@gmail.com>
Authored: Thu Jul 20 23:35:32 2017 -0700
Committer: Benjamin Hindman <be...@gmail.com>
Committed: Tue Aug 1 14:01:50 2017 -0700

----------------------------------------------------------------------
 3rdparty/libprocess/src/process.cpp   |  6 +++---
 3rdparty/libprocess/src/run_queue.hpp | 27 ++++++++++++---------------
 2 files changed, 15 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/fb9f0e78/3rdparty/libprocess/src/process.cpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/process.cpp b/3rdparty/libprocess/src/process.cpp
index 44c3531..698c173 100644
--- a/3rdparty/libprocess/src/process.cpp
+++ b/3rdparty/libprocess/src/process.cpp
@@ -586,9 +586,9 @@ private:
 
   // Queue of runnable processes.
   //
-  // See run_queue.hpp for more information about the RUN_QUEUE
-  // preprocessor definition.
-  RUN_QUEUE runq;
+  // See run_queue.hpp for more information about the run queue
+  // implementation.
+  RunQueue runq;
 
   // Number of running processes, to support Clock::settle operation.
   std::atomic_long running;

http://git-wip-us.apache.org/repos/asf/mesos/blob/fb9f0e78/3rdparty/libprocess/src/run_queue.hpp
----------------------------------------------------------------------
diff --git a/3rdparty/libprocess/src/run_queue.hpp b/3rdparty/libprocess/src/run_queue.hpp
index 109c300..8e2a632 100644
--- a/3rdparty/libprocess/src/run_queue.hpp
+++ b/3rdparty/libprocess/src/run_queue.hpp
@@ -13,21 +13,16 @@
 #ifndef __PROCESS_RUN_QUEUE_HPP__
 #define __PROCESS_RUN_QUEUE_HPP__
 
-// At _configuration_ (i.e., build) time you can specify
-// RUN_QUEUE=... as an environment variable (i.e., just like CC or
-// CXXFLAGS) to pick the run queue implementation. If nothing is
-// specified we'll default to the LockingRunQueue.
+// At _configuration_ (i.e., build) time you can specify './configure
+// --enable-lock-free-run-queue' or 'cmake
+// -DENABLE_LOCK_FREE_RUN_QUEUE to pick the LockFreeRunQueue. By
+// default we'll use the LockingRunQueue.
 //
-// Alternatively we could have made this be a _runtime_ decision but
-// for performance reasons we wanted the run queue implementation to
-// be compile-time optimized (e.g., inlined, etc).
-//
-// Note that care should be taken not to reconfigure with a different
-// value of RUN_QUEUE when reusing a build directory!
-#define RUN_QUEUE LockingRunQueue
+// We choose to make this a _compile-time_ decision rather than a
+// _runtime_ decision because we wanted the run queue implementation
+// to be compile-time optimized (e.g., inlined, etc).
 
 #ifdef LOCK_FREE_RUN_QUEUE
-#define RUN_QUEUE LockFreeRunQueue
 #include <concurrentqueue.h>
 #endif // LOCK_FREE_RUN_QUEUE
 
@@ -42,7 +37,8 @@
 
 namespace process {
 
-class LockingRunQueue
+#ifndef LOCK_FREE_RUN_QUEUE
+class RunQueue
 {
 public:
   bool extract(ProcessBase* process)
@@ -115,9 +111,9 @@ private:
   DecomissionableKernelSemaphore semaphore;
 };
 
+#else // LOCK_FREE_RUN_QUEUE
 
-#ifdef LOCK_FREE_RUN_QUEUE
-class LockFreeRunQueue
+class RunQueue
 {
 public:
   bool extract(ProcessBase*)
@@ -175,6 +171,7 @@ private:
   // Semaphore used for threads to wait for the queue.
   DecomissionableKernelSemaphore semaphore;
 };
+
 #endif // LOCK_FREE_RUN_QUEUE
 
 } // namespace process {