-
Notifications
You must be signed in to change notification settings - Fork 1
Home
"Executor" is library that performs kernel-independent context switching, branch (similar with thread) management and priority - based scheduling. Without kernel scheduler - dependent sleeps and blocking we can boost I/O operation performance and minimize delay between lock-acquire thread and lock-release thread.
Basic Executor based on default branch and context. Supports round-robin and priority - based queueing.
Dispatches a function call to executor. Executor will pack a function to executable one and enqueue this to execution queue. Dispatched function will be executed as a form of basic_execution_branch<...> and must receive branch_execution_handle<>::branch_handle& in first parameter. The method will return a handle for manipulating running branch (basic_executor<...>::running).
Suspends a running branch. Branch will be suspended until explicit "resume" call and will be moved into "suspended queue". The method will return a handle for manipulating suspended branch (basic_executor<...>::suspended).
Resumes a suspended branch. Branch will resume to run until explicit "suspend" call or branch reached return statement. The method will return a handle for manipulating running branch (basic_executor<...>::running) and will be moved into execution queue.
Executes next branch in execution queue. Similar with boost::asio::io_context::run() method. Returns true if target branch for execution exists, false if execution queue is empty.
Sets a trigger for any resume/suspend event in basic_executor<...> object. If trigger::suspended delivered into first parameter, basic_executor<...> object will set trigger to executable delivered into second parameter.
Basic Execution Branch works similar with thread. Every branch - executed function must set its first parameter as "Branch Handle" defined in execution::basic_execution_branch.
- "Context" Library
- (Windows / Linux Both) NASM Assembler
- (In Windows) VirtualAlloc() / VirtualFree()
- (In Linux) mmap() / munmap()