<commit_before>/*ckwg +5
 * Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
 * KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
 * Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
 */

#include "thread_pool_schedule.h"

#include <boost/foreach.hpp>
#include <boost/thread/thread.hpp>

namespace vistk
{

class thread_pool_schedule::priv
{
  public:
    priv();
    ~priv();

    boost::thread_group thread_pool;
};

thread_pool_schedule
::thread_pool_schedule(config_t const& config, pipeline_t const& pipe, size_t num_threads)
  : schedule(config, pipe)
  , m_num_threads(num_threads)
  , d(new priv)
{
}

thread_pool_schedule
::~thread_pool_schedule()
{
}

void
thread_pool_schedule
::start()
{
  /// \todo Map processes to upstream edges.
  /// \todo Map processes to downstream edges.
  /// \todo Initialize all process statuses to 'ready'.
  /// \todo Queue processes while upstreams have data and downstreams aren't full.
}

void
thread_pool_schedule
::wait()
{
  /// \todo Wait until execution is finished.
}

void
thread_pool_schedule
::stop()
{
  /// \todo Shut the schedule down.
}

thread_pool_schedule::priv
::priv()
{
}

thread_pool_schedule::priv
::~priv()
{
}

}<commit_msg>Add some simple logic markers to the tp schedule<commit_after>/*ckwg +5
 * Copyright 2011 by Kitware, Inc. All Rights Reserved. Please refer to
 * KITWARE_LICENSE.TXT for licensing information, or contact General Counsel,
 * Kitware, Inc., 28 Corporate Drive, Clifton Park, NY 12065.
 */

#include "thread_pool_schedule.h"

#include <boost/foreach.hpp>
#include <boost/thread/thread.hpp>

namespace vistk
{

class thread_pool_schedule::priv
{
  public:
    priv();
    ~priv();

    bool complete;

    boost::thread_group thread_pool;
};

thread_pool_schedule
::thread_pool_schedule(config_t const& config, pipeline_t const& pipe, size_t num_threads)
  : schedule(config, pipe)
  , m_num_threads(num_threads)
  , d(new priv)
{
}

thread_pool_schedule
::~thread_pool_schedule()
{
}

void
thread_pool_schedule
::start()
{
  /// \todo Map processes to upstream edges.
  /// \todo Map processes to downstream edges.
  /// \todo Initialize all process statuses to 'ready'.

  while (!d->complete)
  {
    /// \todo Queue processes while upstreams have data and downstreams aren't full.
  }
}

void
thread_pool_schedule
::wait()
{
  d->thread_pool.join_all();
}

void
thread_pool_schedule
::stop()
{
  d->complete = true;
  d->thread_pool.interrupt_all();
}

thread_pool_schedule::priv
::priv()
  : complete(false)
{
}

thread_pool_schedule::priv
::~priv()
{
}

}
{'fraction_non_alphanumeric': 0.12250384024577574, 'fraction_numerical': 0.009216589861751152, 'mean_word_length': 4.241448692152917, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7652159', 'n_tokens_mistral': 914, 'n_tokens_neox': 877, 'n_words': 236}