File Executor.h
-
namespace faabric
-
namespace executor
-
class ChainedCallException : public faabric::util::FaabricException
Public Functions
-
inline explicit ChainedCallException(std::string message)
-
inline explicit ChainedCallException(std::string message)
-
class Executor
Public Functions
-
explicit Executor(faabric::Message &msg)
-
virtual ~Executor()
-
virtual void shutdown()
Shuts down the executor and clears all its state, including its thread pool.
This must be called before destructing an executor. This is because the tidy-up requires implementations of virtual methods held in subclasses, that may depend on state that those subclass instances hold. Because destructors run in inheritance order, this means that state may have been destructed before the executor destructor runs.
-
virtual void reset(faabric::Message &msg)
-
bool tryClaim()
-
void claim()
-
void releaseClaim()
-
std::shared_ptr<faabric::util::SnapshotData> getMainThreadSnapshot(faabric::Message &msg, bool createIfNotExists = false)
-
long getMillisSinceLastExec()
-
virtual std::span<uint8_t> getMemoryView()
-
virtual void restore(const std::string &snapshotKey)
-
faabric::Message &getBoundMessage()
-
bool isExecuting()
-
inline bool isShutdown()
-
void addChainedMessage(const faabric::Message &msg)
-
const faabric::Message &getChainedMessage(int messageId)
-
std::set<unsigned int> getChainedMessageIds()
-
std::vector<faabric::util::SnapshotDiff> mergeDirtyRegions(const Message &msg, const std::vector<char> &extraDirtyPages = {})
-
void setThreadResult(faabric::Message &msg, int32_t returnValue, const std::string &key, const std::vector<faabric::util::SnapshotDiff> &diffs)
-
virtual void setMemorySize(size_t newSize)
Public Members
-
std::string id
Protected Functions
-
virtual size_t getMaxMemorySize()
Protected Attributes
-
faabric::snapshot::SnapshotRegistry ®
-
std::shared_ptr<faabric::util::DirtyTracker> tracker
-
uint32_t threadPoolSize = 0
Private Functions
-
void threadPoolThread(std::stop_token st, int threadPoolIdx)
Private Members
-
std::atomic<bool> claimed = false
-
std::atomic<bool> _isShutdown = false
-
std::atomic<int> batchCounter = 0
-
std::atomic<int> threadBatchCounter = 0
-
std::shared_mutex threadExecutionMutex
-
std::vector<char> dirtyRegions
-
std::vector<std::vector<char>> threadLocalDirtyRegions
-
std::mutex threadsMutex
-
std::vector<std::shared_ptr<std::jthread>> threadPoolThreads
-
std::set<int> availablePoolThreads
-
std::vector<faabric::util::Queue<ExecutorTask>> threadTaskQueues
-
explicit Executor(faabric::Message &msg)
-
class ChainedCallException : public faabric::util::FaabricException
-
namespace executor