mirror of
https://github.com/Z3Prover/z3
synced 2025-04-23 09:05:31 +00:00
#7418 - circumvent use of timer threads to make WASM integration of z3 easier
The scoped_timer uses a std::therad. Spawning this thread fails in cases of WASM. Instead of adapting builds and using async features at the level of WASM and the client, we expose a specialized version of z3 that doesn't use threads at all, neither for solvers nor for timers. The tradeoff is that the periodic poll that checks for timeout directly queries the global clock each time. We characterize it as based on polling.
This commit is contained in:
parent
94f0aff47f
commit
71bad7159b
8 changed files with 124 additions and 31 deletions
|
@ -30,6 +30,7 @@ ENABLE_LTO = True
|
|||
|
||||
IS_PYODIDE = 'PYODIDE_ROOT' in os.environ and os.environ.get('_PYTHON_HOST_PLATFORM', '').startswith('emscripten')
|
||||
|
||||
|
||||
# determine where binaries are
|
||||
RELEASE_DIR = os.environ.get('PACKAGE_FROM_RELEASE', None)
|
||||
if RELEASE_DIR is None:
|
||||
|
@ -133,7 +134,8 @@ def _configure_z3():
|
|||
# Config options
|
||||
cmake_options = {
|
||||
# Config Options
|
||||
'Z3_SINGLE_THREADED' : IS_SINGLE_THREADED,
|
||||
'Z3_SINGLE_THREADED' : IS_SINGLE_THREADED, # avoid solving features that use threads
|
||||
'Z3_POLING_TIMER' : IS_SINGLE_THREADED, # avoid using timer threads
|
||||
'Z3_BUILD_PYTHON_BINDINGS' : True,
|
||||
# Build Options
|
||||
'CMAKE_BUILD_TYPE' : 'Release',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue