You've already forked mariadb-columnstore-engine
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:
@ -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)
|
||||
|
@ -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()
|
||||
{
|
||||
|
Reference in New Issue
Block a user