CPU Polling working properly and dynamically for all cores on Linux systems

This commit is contained in:
Ben
2018-12-10 12:24:05 +00:00
parent da20ea0626
commit 81cfff8a59
7 changed files with 56 additions and 22 deletions

View File

@@ -1,9 +1,9 @@
#pragma once
#include <vector>
#include <map>
#include <thread>
#include <vector>
#include <mutex>
#include <map>
class CPU {
public:

View File

@@ -0,0 +1,31 @@
#pragma once
#include <vector>
#include <thread>
#include <mutex>
class Memory {
public:
Memory();
std::mutex Memory_Mutex;
long double MEMORY_TOTAL_MB;
long double MEMORY_FREE_MB;
long double MEMORY_AVAILABLE_MB;
long double MEMORY_ACTIVE_MB;
long double MEMORY_INACTIVE_MB;
int UPDATE_INTERVAL; // s
void START_MEMORY_POLLING();
static void MEMORY_POLL(Memory* mem);
void END_MEMORY_POLLING();
virtual ~Memory();
private:
std::thread* m_pollThread;
bool m_isPolling;
};
static Memory* Memory_Instance;