parallel/queue: rename the queue type
This commit is contained in:
parent
d47f9e0cce
commit
804b2263b8
@ -14,8 +14,8 @@
|
|||||||
* Copyright 2018 Danny Robson <danny@nerdcruft.net>
|
* Copyright 2018 Danny Robson <danny@nerdcruft.net>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef CRUFT_UTIL_PARALLEL_SPMC_HPP
|
#ifndef CRUFT_UTIL_PARALLEL_QUEUE_HPP
|
||||||
#define CRUFT_UTIL_PARALLEL_SPMC_HPP
|
#define CRUFT_UTIL_PARALLEL_QUEUE_HPP
|
||||||
|
|
||||||
#include "../maths.hpp"
|
#include "../maths.hpp"
|
||||||
|
|
||||||
@ -30,7 +30,7 @@ namespace util::parallel {
|
|||||||
/// \tparam ValueT the type of values to store
|
/// \tparam ValueT the type of values to store
|
||||||
/// \tparam SizeV the number of elements in the underlying store
|
/// \tparam SizeV the number of elements in the underlying store
|
||||||
template <typename ValueT, uint32_t SizeV = 32>
|
template <typename ValueT, uint32_t SizeV = 32>
|
||||||
class spmc {
|
class queue {
|
||||||
public:
|
public:
|
||||||
// We optimise specifically for memcpyable types only
|
// We optimise specifically for memcpyable types only
|
||||||
static_assert (
|
static_assert (
|
||||||
@ -46,7 +46,7 @@ namespace util::parallel {
|
|||||||
// pointers. 4 gives a little safety margin for future optimisations.
|
// pointers. 4 gives a little safety margin for future optimisations.
|
||||||
static_assert (SizeV >= 4);
|
static_assert (SizeV >= 4);
|
||||||
|
|
||||||
spmc ():
|
queue ():
|
||||||
m_write (0),
|
m_write (0),
|
||||||
m_read { {0}, {0} }
|
m_read { {0}, {0} }
|
||||||
{ ; }
|
{ ; }
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#include "parallel/spmc.hpp"
|
#include "parallel/queue.hpp"
|
||||||
#include "job/flag.hpp"
|
#include "job/flag.hpp"
|
||||||
#include "job/semaphore.hpp"
|
#include "job/semaphore.hpp"
|
||||||
#include "debug.hpp"
|
#include "debug.hpp"
|
||||||
@ -15,7 +15,7 @@ static constexpr int chunk_size = 1<<12;
|
|||||||
|
|
||||||
util::job::flag start;
|
util::job::flag start;
|
||||||
|
|
||||||
using queue_t = util::parallel::spmc<int,slots>;
|
using queue_t = util::parallel::queue<int,slots>;
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
Reference in New Issue
Block a user