mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-20 20:03:44 +00:00
Estimated hours taken: 50 Branches: main This patch adds preliminary support for deterministic, dependent parallel conjunctions to the low-level backend. In other backends dependent parallel conjunctions are converted into plain conjunctions. For a parallel conjunction (A & B), if the goal B is dependent on a variable X which is bound by goal A, we transform the conjunction such that goal B must wait for the value to be produced by A before it begins executing. This transformation is not yet useful in practice (you might as well use a sequential conjunction). A later version of this transformation will move the synchronisation deeper into the goals so that B can execute as much as possible before it waits for the value from A. There is no coroutining support yet so if there are not enough threads available then dependent parallel conjunctions can cause the program to deadlock. configure.in: runtime/mercury_conf.h.in: Check for existence of semaphore.h and #define MR_HAVE_SEMAPHORE_H if it does. library/library.m: library/par_builtin.m: library/private_builtin.m: mdbcomp/prim_data.m: mdbcomp/program_representation.m: Add a new module `par_builtin' to hold synchronisation primitives. compiler/modules.m: Import `par_builtin' module in parallel grades. compiler/dep_par_conj.m: compiler/transform_hlds.m: compiler/mercury_compile.m: Add a transformation to detect dependent parallel conjunctions and insert the necessary synchronisation code. compiler/hlds_goal.m: Consider empty parallel conjunctions as atomic, the same as plain conjunctions. compiler/inlining.m: Flatten parallel conjunctions when inlining, as for plain conjunctions. compiler/live_vars.m: Fix build_live_sets_in_par_conj to handle dependent parallel conjunctions. compiler/liveness.m: Delay deaths in parallel conjunctions the same way as for plain conjunctions. Update detect_resume_points_in_par_conj for dependent parallel conjunctions. compiler/mode_util.m: Treat parallel and plain conjunctions equally when recomputing instmap deltas. compiler/modes.m: compiler/unique_modes.m: Treat parallel and plain conjunctions equally when checking modes and uniqueness. However, don't flatten parallel conjunctions into plain conjunctions and vice versa. compiler/simplify.m: Don't reset instmaps and seen calls after each conjunct of a parallel conjunction. compiler/store_alloc.m: Update allocation for dependent parallel conjunctions. compiler/switch_detection.m: Detect switches in parallel conjunctions the same as plain conjunctions. compiler/par_conj_gen.m: Add a todo comment. tests/Mmakefile: tests/par_conj/.cvsignore: tests/par_conj/Mmakefile: tests/par_conj/dep_par_1.m: tests/par_conj/dep_par_10.m: tests/par_conj/dep_par_11.m: tests/par_conj/dep_par_11b.m: tests/par_conj/dep_par_11c.m: tests/par_conj/dep_par_12.m: tests/par_conj/dep_par_13.m: tests/par_conj/dep_par_14.m: tests/par_conj/dep_par_14b.m: tests/par_conj/dep_par_14c.m: tests/par_conj/dep_par_14d.m: tests/par_conj/dep_par_16.m: tests/par_conj/dep_par_17.m: tests/par_conj/dep_par_18.m: tests/par_conj/dep_par_2.m: tests/par_conj/dep_par_20.m: tests/par_conj/dep_par_21.m: tests/par_conj/dep_par_22.m: tests/par_conj/dep_par_23.m: tests/par_conj/dep_par_3.m: tests/par_conj/dep_par_3b.m: tests/par_conj/dep_par_3c.m: tests/par_conj/dep_par_4.m: tests/par_conj/dep_par_5.m: tests/par_conj/dep_par_5b.m: tests/par_conj/dep_par_5c.m: tests/par_conj/dep_par_5d.m: tests/par_conj/dep_par_6.m: tests/par_conj/dep_par_7.m: tests/par_conj/dep_par_8.m: tests/par_conj/dep_par_9.m: tests/par_conj/indep_par_append.exp: tests/par_conj/indep_par_append.m: tests/par_conj/indep_par_nested.exp: tests/par_conj/indep_par_nested.m: Add some parallel conjunction test cases. The dependent parallel conjunction tests are not yet executed as they can deadlock if there are not enough threads available. browser/RESERVED_MACRO_NAMES: library/RESERVED_MACRO_NAMES: runtime/RESERVED_MACRO_NAMES: trace/RESERVED_MACRO_NAMES: Add LINUX_THREADS, _REENTRANT and _THREAD_SAFE.
2 lines
61 B
Plaintext
2 lines
61 B
Plaintext
{100, 101, 102, 103, 200, 201, 202, 203, 300, 301, 302, 303}
|