Did you know ... Search Documentation:
Predicate create_pool/1
 create_pool(+PoolName) is semidet[multifile, library(thread_pool)]
Hook to create a thread pool lazily. The hook is called if thread_create_in_pool/4 discovers that the thread pool does not exist. If the hook succeeds, thread_create_in_pool/4 retries creating the thread. For example, we can use the following declaration to create threads in the pool media, which holds a maximum of 20 threads.
:- multifile thread_pool:create_pool/1.

thread_pool:create_pool(media) :-
    thread_pool_create(media, 20, []).
 thread_pool:create_pool(+Application) is det[multifile, library(pengines)]
On demand creation of a thread pool for a pengine application.