1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-5001 This patch merges ExeMgr and PrimProc runtimes

EM and PP are most resource-hungry runtimes.
        The merge enables to control their cummulative
        resource consumption, thread allocation + enables
        zero-copy data exchange b/w local EM and PP facilities.
This commit is contained in:
Roman Nozdrin
2022-03-02 17:13:29 +00:00
committed by Roman Nozdrin
parent 2ec502aaf3
commit e174696351
23 changed files with 2443 additions and 111 deletions

View File

@ -2,6 +2,10 @@
#include <atomic>
// To be refactored. There are two issues with this implentation.
// 1. It can be replaced with a lock despite the memory_order_acquire/release mem order. Needs
// std::atomic_flag instead.
// 2. https://www.realworldtech.com/forum/?threadid=189711&curpostid=189723
namespace utils
{
inline void getSpinlock(std::atomic<bool>& lock)
@ -23,4 +27,29 @@ inline void releaseSpinlock(std::atomic<bool>& lock)
lock.store(false, std::memory_order_release);
}
// c++20 offers a combination of wait/notify methods but
// I prefer to use a simpler version of uspace spin lock.
class USpaceSpinLock
{
public:
USpaceSpinLock(std::atomic_flag& flag) : flag_(flag)
{
while (flag_.test_and_set(std::memory_order_acquire))
{
;
}
};
~USpaceSpinLock()
{
release();
};
inline void release()
{
flag_.clear(std::memory_order_release);
}
private:
std::atomic_flag& flag_;
};
} // namespace utils

View File

@ -20,41 +20,11 @@
#include <iostream>
#include <vector>
#include <boost/shared_ptr.hpp>
#ifdef _MSC_VER
#include <unordered_map>
#else
#include <tr1/unordered_map>
#endif
#include "../common/simpleallocator.h"
#ifndef _HASHFIX_
#define _HASHFIX_
#ifndef __LP64__
#if __GNUC__ == 4 && __GNUC_MINOR__ < 2
// This is needed for /usr/include/c++/4.1.1/tr1/functional on 32-bit compiles
// tr1_hashtable_define_trivial_hash(long long unsigned int);
namespace std
{
namespace tr1
{
template <>
struct hash<long long unsigned int> : public std::unary_function<long long unsigned int, std::size_t>
{
std::size_t operator()(long long unsigned int val) const
{
return static_cast<std::size_t>(val);
}
};
} // namespace tr1
} // namespace std
#endif
#endif
#endif
#define NO_DATALISTS
#include "../joblist/elementtype.h"
#undef NO_DATALISTS
namespace joiner
{