```{index} single: Test2::Manual::Concurrency ``` # Test2::Manual::Concurrency Documentation for Concurrency support. ## FORKING ### Test2 Test2 supports forking. For forking to work you need to load [Test2::IPC](../IPC.md). ### Test::Builder [Test::Builder](../../Test/Builder.md) Did not used to support forking, but now that it is based on [Test2](../../Test2.md) it does. [Test2::IPC](../IPC.md) must be loaded just as with [Test2](../../Test2.md). ### Test2::Suite [Test2::Suite](../Suite.md) tools should all work fine with _true_ forking unless otherwise noted. Pseudo-fork via threads (Windows and a few others) is not supported, but may work. Patches will be accepted to repair any pseudo-fork issues, but for these to be used or tested they must be requested. Fork tests should not run on pseudo-fork systems unless they are requested with an environment var, or the AUTHOR\_TESTING var. Pseudo-fork is fragile, and we do not want to block install due to a pseudo-fork flaw. ### Test::SharedFork [Test::SharedFork](https://metacpan.org/pod/Test::SharedFork) is currently support and maintained, though it is no longer necessary thanks to [Test2::IPC](../IPC.md). If usage ever drops off then the module may be deprecated, but for now the policy is to not let it break. Currently it simply loads [Test2::IPC](../IPC.md) if it can, and falls back to the old methods on legacy installs. ### Others Individual authors are free to support or not support forking as they see fit. ## THREADING **Note** This only applies to ithreads. ### Test2 The core of Test2 supports threading so long as [Test2::IPC](../IPC.md) is loaded. Basic threading support (making sure events make it to the parent thread) is fully supported, and must not be broken. Some times perl installs have broken threads (Some 5.10 versions compiled on newer gcc's will segv by simply starting a thread). This is beyond Test2's control, and not solvable in Test2. That said we strive for basic threading support on perl 5.8.1+. If Test2 fails for threads on any perl 5.8 or above, and it is reasonably possible for Test2 to work around the issue, it should. (Patches and bug reports welcome). ### Test::Builder [Test::Builder](../../Test/Builder.md) has had thread support for a long time. With Test2 the mechanism for thread support was switched to [Test2::IPC](../IPC.md). [Test::Builder](../../Test/Builder.md) should still support threads as much as it did before the switch to Test2. Support includes auto-enabling thread support if [threads](../../threads.md) is loaded before Test::Builder. If there is a deviation between the new and old threading behavior then it is a bug (unless the old behavior itself can be classified as a bug.) Please report (or patch!) any such threading issues. ### Test2::Suite Tools in [Test2::Suite](../Suite.md) have minimal threading support. Most of these tools do not care/notice threading and simply work because [Test2::IPC](../IPC.md) handles it. Feel free to report any thread related bugs in Test2::Suite. Be aware though that these tools are not legacy, and have no pre-existing thread support, we reserve the right to refuse adding thread support to them. #### Test2::Workflow [Test2::Workflow](../Workflow.md) has been merged into [Test2::Suite](../Suite.md), so it gets addressed by this policy. [Test2::Workflow](../Workflow.md) has thread support, but you must ask for it. Thread tests for Test2::Workflow do not event run without setting either the AUTHOR\_TESTING env var, or the T2\_DO\_THREAD\_TESTS env var. To use threads with Test2::Workflow you must set the T2\_WORKFLOW\_USE\_THREADS env var. If you do rely on threads with Test2::Workflow and find a bug please report it, but it will be given an ultra-low priority. Merging patches that fix threading issues will be given normal priority. ## SEE ALSO [Test2](../../Test2.md) - Test2 itself. [Test2::Suite](../Suite.md) - Initial tools built using [Test2](../../Test2.md). [Test2::Manual](../Manual.md) - Primary index of the manual. ## SOURCE The source code repository for Test2-Manual can be found at `https://github.com/Test-More/test-more/`. ## MAINTAINERS - Chad Granum ## AUTHORS - Chad Granum ## COPYRIGHT Copyright Chad Granum . This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See `http://dev.perl.org/licenses/`