I’ve encountered a few predicates that give warnings about threading. For example: unload_file/1 says:
“…attempts to do this should be reserved for development or situations where the application can guarantee that none of the clauses associated to File are active.”
and the library(persistency) docs say:
“This module requires the same thread-synchronization as the normal Prolog database. This implies that if each individual assert or retract takes the database from one consistent state to the next, no additional locking is required. If more than one elementary database operation is required to get from one consistent state to the next, both updating and querying the database must be locked using with_mutex/2.”
My assumption is that, unless I use a predicate that explicitly creates a thread, all of my code is single threaded, at least from the perspective of the library calls. I.e. the underlying system may use threads but that is hidden from me and I don’t have to worry about locking.
Is this correct?