/usr/local/lib/swipl/library/thread.pl
All Application Manual Name SummaryHelp

  • swipl
    • library
      • error.pl
      • debug.pl
      • apply.pl -- Apply predicates on a list
      • lists.pl
      • broadcast.pl -- Event service
      • shlib.pl -- Utility library for loading foreign objects (DLLs, shared objects)
      • option.pl -- Option list processing
      • thread_pool.pl -- Resource bounded thread management
      • gensym.pl -- Generate unique symbols
      • settings.pl -- Setting management
      • arithmetic.pl
      • main.pl -- Provide entry point for scripts
      • readutil.pl
      • operators.pl -- Manage operators
      • pairs.pl
      • prolog_source.pl -- Examine Prolog source-files
      • record.pl -- Access compound arguments by name
      • quasi_quotations.pl -- Define Quasi Quotation syntax
      • pure_input.pl
      • solution_sequences.pl -- Modify solution sequences
      • ordsets.pl -- Ordered set manipulation
      • random.pl
      • base64.pl
      • aggregate.pl -- Aggregation operators on backtrackable predicates
      • yall.pl -- Lambda expressions
      • sandbox.pl
      • apply_macros.pl -- Goal expansion rules to avoid meta-calling
      • assoc.pl -- Binary associations
      • prolog_format.pl
      • predicate_options.pl -- Access and analyse predicate options
      • csv.pl -- Process CSV (Comma-Separated Values) data
      • pprint.pl -- Pretty Print Prolog terms
      • atom.pl -- Operations on atoms
      • modules.pl
      • occurs.pl -- Finding and counting sub-terms
      • prolog_xref.pl
      • prolog_colour.pl
      • lazy_lists.pl -- Lazy list handling
      • ugraphs.pl -- Graph manipulation library
      • url.pl -- Analysing and constructing URL
      • www_browser.pl -- Open a URL in the users browser
      • prolog_pack.pl -- A package manager for Prolog
      • git.pl -- Run GIT commands
      • utf8.pl
      • dialect.pl -- Support multiple Prolog dialects
      • system.pl
      • terms.pl -- Term manipulation
      • date.pl
      • persistency.pl -- Provide persistent dynamic predicates
      • iostream.pl -- Utilities to deal with streams
      • prolog_stack.pl
      • edinburgh.pl
      • prolog_clause.pl
      • prolog_breakpoints.pl
      • wfs.pl
      • prolog_code.pl
      • sort.pl
      • dicts.pl -- Dict utilities
      • dif.pl -- The dif/2 constraint
      • varnumbers.pl
      • pio.pl
      • ctypes.pl
      • listing.pl -- List programs and pretty print clauses
      • backcomp.pl -- Backward compatibility
      • portray_text.pl
      • base32.pl
      • charsio.pl -- I/O on Lists of Character Codes
      • codesio.pl -- I/O on Lists of Character Codes
      • coinduction.pl -- Co-Logic Programming
      • heaps.pl
      • rbtrees.pl
      • statistics.pl -- Get information about resource usage
      • when.pl -- Conditional coroutining
      • quintus.pl -- Quintus compatibility
      • prolog_profile.pl -- Execution profiler
      • increval.pl -- Incremental dynamic predicate modification
      • tables.pl -- XSB interface to tables
      • shell.pl
      • prolog_codewalk.pl -- Prolog code walker
      • prolog_metainference.pl
      • ansi_term.pl
      • edit.pl
      • fastrw.pl -- Fast reading and writing of terms
      • threadutil.pl -- Interactive thread utilities
      • prolog_coverage.pl -- Coverage analysis tool
      • qsave.pl
      • zip.pl -- Access resource ZIP archives
      • intercept.pl -- Intercept and signal interface
      • check.pl -- Consistency checking
      • prolog_jiti.pl -- Just In Time Indexing (JITI) utilities
      • optparse.pl -- command line parsing
      • make.pl -- Reload modified source files
      • thread.pl -- High level thread primitives
        • concurrent/3
        • concurrent_forall/2
        • concurrent_forall/3
        • concurrent_and/2
        • concurrent_and/3
        • concurrent_maplist/2
        • concurrent_maplist/3
        • concurrent_maplist/4
        • first_solution/3
        • call_in_thread/2
      • prolog_versions.pl -- Demand specific (Prolog) versions
      • prolog_wrap.pl
      • hashtable.pl -- Hash tables
      • nb_set.pl
      • help.pl
      • prolog_debug.pl -- User level debugging tools
      • readln.pl
      • strings.pl
      • streams.pl -- Manage Prolog streams
      • writef.pl
      • macros.pl
      • prolog_autoload.pl -- Autoload all dependencies
      • prolog_config.pl
      • exceptions.pl -- Exception classification
      • prolog_trace.pl -- Print access to predicates
      • rwlocks.pl -- Read/write locks
      • oset.pl -- Ordered set manipulation
      • files.pl
      • tty.pl -- Terminal operations
      • explain.pl -- Describe Prolog Terms
 concurrent_and(:Generator, :Test)
 concurrent_and(:Generator, :Test, +Options)
Concurrent version of (Generator,Test). This predicate creates a thread providing solutions for Generator that are handed to a pool of threads that run Test for the different instantiations provided by Generator concurrently. The predicate is logically equivalent to a simple conjunction except for two aspects: (1) terms are copied from Generator to the test Test threads while answers are copied back to the calling thread and (2) answers may be produced out of order.

If the evaluation of some Test raises an exception, concurrent_and/2,3 is terminated with this exception. If the caller commits after a given answer or raises an exception while concurrent_and/2,3 is active with pending choice points, all involved resources are reclaimed.

Options:

threads(+Count)
Create a worker pool holding Count threads. The default is the Prolog flag cpu_count.

This predicate was proposed by Jan Burse as balance((Generator,Test)).