Support for multiple threads

This commit is contained in:
tevador
2018-12-19 21:54:44 +01:00
parent cb12feaf91
commit b9d2d853aa
13 changed files with 436 additions and 304 deletions
+2 -20
View File
@@ -26,30 +26,12 @@ namespace RandomX {
class VirtualMachine {
public:
VirtualMachine(bool softAes);
virtual ~VirtualMachine() {}
virtual void initializeDataset(const void* seed, bool light = false);
virtual ~VirtualMachine();
virtual void setDataset(dataset_t ds, bool light = false);
void initializeScratchpad(uint32_t index);
virtual void initializeProgram(const void* seed) = 0;
virtual void execute() = 0;
void getResult(void*);
const RegisterFile& getRegisterFile() const {
return reg;
}
const convertible_t* getScratchpad() const {
return scratchpad;
}
const void* getCache() {
if (lightClient) {
return mem.lcm->cache;
}
return nullptr;
}
const __m128i* getKeys() {
if (lightClient) {
return mem.lcm->keys;
}
return nullptr;
}
protected:
bool softAes, lightClient;
RegisterFile reg;