diff --git a/executor/executor.cc b/executor/executor.cc
new file mode 100644
index 0000000..87b5760
--- /dev/null
+++ b/executor/executor.cc
@@ -0,0 +1,129 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2013, Regents of the University of California
+ *                     Alexander Afanasyev
+ *                     Zhenkai Zhu
+ *
+ * BSD license, See the LICENSE file for more information
+ *
+ * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#include "executor.h"
+#include "logging.h"
+
+INIT_LOGGER("Executor")
+
+using namespace std;
+using namespace boost;
+
+Executor::Executor (int poolSize)
+  : m_needStop (true)
+  , m_poolSize (poolSize)
+{
+}
+
+Executor::~Executor()
+{
+  _LOG_DEBUG ("Enter destructor");
+  shutdown ();
+  _LOG_DEBUG ("Exit destructor");
+}
+
+void
+Executor::start ()
+{
+  if (m_needStop)
+    {
+      m_needStop = false;
+      for (int i = 0; i < m_poolSize; i++)
+        {
+          m_group.create_thread (bind(&Executor::run, this));
+        }
+    }
+}
+
+void
+Executor::shutdown ()
+{
+  if (!m_needStop)
+    {
+      m_needStop = true;
+      _LOG_DEBUG ("Iterrupting all");
+      m_group.interrupt_all ();
+      _LOG_DEBUG ("Join all");
+      m_group.join_all ();
+    }
+}
+
+
+void
+Executor::execute(const Job &job)
+{
+  _LOG_DEBUG ("Add to job queue");
+
+  Lock lock(m_mutex);
+  bool queueWasEmpty = m_queue.empty ();
+  m_queue.push_back(job);
+
+  // notify working threads if the queue was empty
+  if (queueWasEmpty)
+  {
+    m_cond.notify_one ();
+  }
+}
+
+int
+Executor::poolSize()
+{
+  return m_group.size();
+}
+
+int
+Executor::jobQueueSize()
+{
+  Lock lock(m_mutex);
+  return m_queue.size();
+}
+
+void
+Executor::run ()
+{
+  _LOG_DEBUG ("Start thread");
+
+  while(!m_needStop)
+  {
+    Job job = waitForJob();
+
+    _LOG_DEBUG (">>> enter job");
+    job (); // even if job is "null", nothing bad will happen
+    _LOG_DEBUG ("<<< exit job");
+  }
+
+  _LOG_DEBUG ("Executor thread finished");
+}
+
+Executor::Job
+Executor::waitForJob()
+{
+  Lock lock(m_mutex);
+
+  // wait until job queue is not empty
+  while (m_queue.empty())
+  {
+    _LOG_DEBUG ("Unlocking mutex for wait");
+    m_cond.wait(lock);
+    _LOG_DEBUG ("Re-locking mutex after wait");
+  }
+
+  _LOG_DEBUG ("Got signal on condition");
+
+  Job job;
+  if (!m_queue.empty ()) // this is not always guaranteed, especially after interruption from destructor
+    {
+      job = m_queue.front();
+      m_queue.pop_front();
+    }
+  return job;
+}
diff --git a/executor/executor.h b/executor/executor.h
new file mode 100644
index 0000000..dd9eac3
--- /dev/null
+++ b/executor/executor.h
@@ -0,0 +1,80 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
+/*
+ * Copyright (c) 2013, Regents of the University of California
+ *                     Alexander Afanasyev
+ *                     Zhenkai Zhu
+ *
+ * BSD license, See the LICENSE file for more information
+ *
+ * Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
+ *         Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ */
+
+#ifndef EXECUTOR_H
+#define EXECUTOR_H
+
+#include <boost/function.hpp>
+#include <boost/shared_ptr.hpp>
+#include <boost/thread/condition_variable.hpp>
+#include <boost/thread/mutex.hpp>
+#include <boost/thread/locks.hpp>
+#include <boost/thread/thread.hpp>
+#include <deque>
+
+/* A very simple executor to execute submitted tasks immediately or
+ * in the future (depending on whether there is idle thread)
+ * A fixed number of threads are created for executing tasks;
+ * The policy is FIFO
+ * No cancellation of submitted tasks
+ */
+
+class Executor
+{
+public:
+  typedef boost::function<void ()> Job;
+
+  Executor(int poolSize);
+  ~Executor();
+
+  // execute the job immediately or sometime in the future
+  void
+  execute(const Job &job);
+
+  int
+  poolSize();
+
+// only for test
+  int
+  jobQueueSize();
+
+  void
+  start ();
+
+  void
+  shutdown ();
+
+private:
+  void
+  run();
+
+  Job
+  waitForJob();
+
+private:
+  typedef std::deque<Job> JobQueue;
+  typedef boost::mutex Mutex;
+  typedef boost::unique_lock<Mutex> Lock;
+  typedef boost::condition_variable Cond;
+  typedef boost::thread Thread;
+  typedef boost::thread_group ThreadGroup;
+  JobQueue m_queue;
+  Mutex m_mutex;
+  Cond m_cond;
+  ThreadGroup m_group;
+
+  volatile bool m_needStop;
+  int m_poolSize;
+};
+
+typedef boost::shared_ptr<Executor> ExecutorPtr;
+#endif // EXECUTOR_H
