1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL4841 dev port run large join without OOM

This commit is contained in:
David Hall
2022-02-09 17:33:55 -06:00
parent d30e140dc3
commit 27dea733c5
34 changed files with 821 additions and 518 deletions

View File

@ -42,6 +42,7 @@ using namespace std;
using namespace logging;
#include "MonitorProcMem.h"
#include "threadnaming.h"
namespace utils
{
@ -56,6 +57,7 @@ int MonitorProcMem::fMemPctCheck = 0;
//------------------------------------------------------------------------------
void MonitorProcMem::operator()() const
{
utils::setThreadName("MonitorProcMem");
while (1)
{
if (fMaxPct > 0)

View File

@ -154,6 +154,24 @@ inline bool atomicCAS(volatile T* mem, T comp, T swap)
#endif
}
// implements a zero out of a variable
template <typename T>
inline void atomicZero(volatile T* mem)
{
#ifdef _MSC_VER
switch (sizeof(T))
{
case 4:
default: InterlockedXor(reinterpret_cast<volatile LONG*>(mem), (static_cast<LONG>(*mem))); break;
case 8: InterlockedXor64(reinterpret_cast<volatile LONG*>(mem), (static_cast<LONG>(*mem))); break;
}
#else
__sync_xor_and_fetch(mem, *mem);
#endif
}
// Implements a scheduler yield
inline void atomicYield()
{