flowlog.c)This document describes the runtime model of Flowlog as built from flowlog.c. It is intended for
developers and performance work.
Code references (section markers in flowlog.c):
Flowlog has one OS process and may create pthread workers when (SECTIONS 07/21):
Thread usage is intentionally bounded (SECTION 01 and SECTION 07):
flowlog_parallel_profile=fast,
depth cutoffs and OR-par nesting limits prevent runaway spawning.flowlog_parallel_profile=iso for ordered commits,
or flowlog_parallel_profile=off to disable Flowlog parallel
features.Flowlog:
sysconf(_SC_NPROCESSORS_ONLN)) (SUBSECTION 04.2)--threads N or
FLOWLOG_N_CPUPROC=NOR-par workers execute deep recursive solver code. To avoid stack overflows while also staying safe on high-core machines, Flowlog (SUBSECTION 04.3):
FLOWLOG_ORPAR_STACK_SIZESome systems also default to a small main thread stack (for
example, Linux often defaults to 8 MiB). When the interpreter engine
runs deep recursive goals (notably --engine tree), this can
overflow the main stack. Flowlog can optionally run its main loop on a
dedicated pthread with a larger stack when RLIMIT_STACK is
small; see FLOWLOG_STACK_BOOST and
FLOWLOG_MAIN_STACK_SIZE in CLI.md (SUBSECTION 26.3).
Flowlog’s core solver allocates many short-lived objects (terms, environments, temporary vectors) (SECTION 09).
This build uses:
Tuning:
FLOWLOG_POOL_LOCAL_ALLOC=on can reduce allocator
contention on some OR-par workloads (SUBSECTION 09.3).When running in the TTY REPL (SUBSECTION 04.3 and SECTION 26):
SIGINFO) prints a live status report
(predicate, depth, parallel flags, memory counters).When not a TTY (piped input), Ctrl-C/Ctrl-T behavior depends on your shell/terminal and may not be delivered to Flowlog.
Flowlog uses process-local FILE* streams and implements
the ISO stream predicates directly (SECTION 08 and SUBSECTION 17.5).
REPL note:
Flowlog prints results in a test-friendly format (SECTION 17):
true / falseX = 1, Y = fooerror(...) termsFor scripting, treat stdout as the primary “transcript” stream.
Environment variables:
FLOWLOG_DEBUG_ORPAR - logging levelFLOWLOG_DEBUG_ORPAR_LOG - file path to append logsThese logs are intended to help identify: