A.55 library(thread_pool): Resource bounded thread management
AllApplicationManualNameSummaryHelp

  • Documentation
    • Reference manual
      • The SWI-Prolog library
        • library(thread_pool): Resource bounded thread management
          • thread_pool_create/3
          • thread_pool_destroy/1
          • current_thread_pool/1
          • thread_pool_property/2
          • thread_create_in_pool/4
          • worker_exitted/3
          • create_pool/1
    • Packages
Availability::- use_module(library(thread_pool)).
Source[semidet,multifile]create_pool(+PoolName)
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, []).