[ Web Proxy ]
URL:
Viewing: https://raw.githubusercontent.com/tide999/cpp-taskflow/master/unittest/threadpool.cpp [Back]  [Original]

// 2018/12/04 - modified by Tsung-Wei Huang
//   - replaced privatized threadpool with work stealing threadpool
//
// 2018/12/03 - modified by Tsung-Wei Huang
//   - added work stealing queue tests
//
// 2018/11/29 - modified by Chun-Xun Lin
//   - added batch tests
//
// 2018/10/04 - modified by Tsung-Wei Huang
//   - removed binary tree tests
//   - removed spawn/shutdown tests
//   - removed siltne_async and async tests
//   - added emplace test
//   - adopted the new thread pool implementation
//
// 2018/09/29 - modified by Tsung-Wei Huang
//   - added binary tree tests
//   - added worker queue tests
//   - added external thread tests
//   - refactored threadpool tests
// 
// 2018/09/13 - modified by Tsung-Wei Huang & Chun-Xun
//   - added tests for ownership
//   - modified spawn-shutdown tests
//
// 2018/09/10 - modified by Tsung-Wei Huang
//   - added tests for SpeculativeThreadpool
//   - added dynamic tasking tests
//   - added spawn and shutdown tests
//
// 2018/09/02 - created by Guannan
//   - test_silent_async
//   - test_async
//   - test_wait_for_all

#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN

#include 
#include 

// ============================================================================
// WorkStealingQueue tests
// ============================================================================

// Procedure: wsq_test_owner
void wsq_test_owner() {

  int64_t cap = 2;
  
  tf::WorkStealingQueue queue(cap);
  std::deque gold;

  REQUIRE(queue.capacity() == 2);
  REQUIRE(queue.empty());

  for(int i=2; i

Web Proxy Viewer  |  New URL  |  Original Page