KawPow: reduced stale/expired shares

This commit is contained in:
SChernykh 2020-05-31 18:22:21 +02:00
parent 95ef32c913
commit 9cbdb7f1f2
22 changed files with 218 additions and 104 deletions

View file

@ -42,10 +42,11 @@ class Worker : public IWorker
public:
Worker(size_t id, int64_t affinity, int priority);
inline const VirtualMemory *memory() const override { return nullptr; }
inline size_t id() const override { return m_id; }
inline uint64_t hashCount() const override { return m_hashCount.load(std::memory_order_relaxed); }
inline uint64_t timestamp() const override { return m_timestamp.load(std::memory_order_relaxed); }
inline const VirtualMemory *memory() const override { return nullptr; }
inline size_t id() const override { return m_id; }
inline uint64_t hashCount() const override { return m_hashCount.load(std::memory_order_relaxed); }
inline uint64_t timestamp() const override { return m_timestamp.load(std::memory_order_relaxed); }
inline void jobEarlyNotification(const Job&) override {}
protected:
void storeStats();

View file

@ -47,6 +47,7 @@ namespace xmrig {
class Hashrate;
class WorkersPrivate;
class Job;
template<class T>
@ -63,6 +64,7 @@ public:
void start(const std::vector<T> &data);
void stop();
void tick(uint64_t ticks);
void jobEarlyNotification(const Job&);
private:
static IWorker *create(Thread<T> *handle);
@ -73,6 +75,17 @@ private:
};
template<class T>
void xmrig::Workers<T>::jobEarlyNotification(const Job& job)
{
for (Thread<T>* t : m_workers) {
if (t->worker()) {
t->worker()->jobEarlyNotification(job);
}
}
}
template<>
IWorker *Workers<CpuLaunchData>::create(Thread<CpuLaunchData> *handle);
extern template class Workers<CpuLaunchData>;

View file

@ -34,6 +34,7 @@ namespace xmrig {
class VirtualMemory;
class Job;
class IWorker
@ -48,6 +49,7 @@ public:
virtual uint64_t hashCount() const = 0;
virtual uint64_t timestamp() const = 0;
virtual void start() = 0;
virtual void jobEarlyNotification(const Job&) = 0;
};