pub struct ThreadedSolver<S> { /* private fields */ }Expand description
Runs each question on its own thread and waits at most timeout: an answer that is late is
abandoned and reported as MbaAnswer::Exhausted (never cached, so a later call may try
again). While max_abandoned abandoned questions are still running, new ones are refused
as exhausted, which bounds the threads left behind. The only threads are the ones this
instance starts; nothing is global.
A deadline makes answers depend on timing; the engine treats an exhausted answer as not final, so a memoized result never depends on it. A panic inside the solver is answered as unsupported. The cap is checked before a question starts, so concurrent callers may briefly exceed it by their number.
Implementations§
Trait Implementations§
Source§impl<S> Debug for ThreadedSolver<S>
impl<S> Debug for ThreadedSolver<S>
Source§impl<S: MbaSolver + 'static> MbaSolver for ThreadedSolver<S>
impl<S: MbaSolver + 'static> MbaSolver for ThreadedSolver<S>
Source§fn solve_counted(&self, p: &MbaExpr, budget: &MbaBudget) -> (MbaAnswer, u64)
fn solve_counted(&self, p: &MbaExpr, budget: &MbaBudget) -> (MbaAnswer, u64)
The inner solver’s steps; a question abandoned at the deadline is charged its limit (it may still be running), one refused or not started nothing.
Source§fn id(&self) -> &str
fn id(&self) -> &str
Source§fn polynomial_fragments(&self) -> bool
fn polynomial_fragments(&self) -> bool
Phase::Mba should also ask about polynomials: fragments without bitwise
operators in which two non-constants are multiplied, and fragments rooted at a constant
left shift. By default only mixed fragments (arithmetic and bitwise operators) rooted at
+ − · neg & | ^ ~ are asked about.