SWI-Prolog Did You Know Did you know? SWI-Prolog has Multi-Thread support Search Documentation:
Predicate prolog_close_source/1