DiaColloDB::threads::shared - wrapper for threads/shared.pm or forks/shared.pm
##======================================================================== ## PRELIMINARIES use DiaColloDB::threads::shared; $module = $DiaColloDB::threads::shared::MODULE; if ($DiaColloDB::threads::shared::MODULE) { ##-- you can use the threads::shared API my ($var); share($var); lock($var); #... etc. }
The DiaColloDB::threads::shared module attempts to load shared variable support for (pseudo)-threads from either threads/shared.pm or forks/shared.pm, depending on whether or not your perl has builtin thread support according to $Config{usethreads}. It also wraps the import() method of whatever module it actually loads, so it should work as a drop-in replacement for whatever threads::shared-like module you have available.
DiaColloDB::threads::shared
$Config{usethreads}
import()
threads::shared
After using DiaColloDB::threads::shared, the variable $DiaColloDB::threads::shared::MODULE is set to the name of the module providing the underlying threads::shared implementation (either threads::shared or forks::shared), if any. Otherwise, it is set to the empty string.
$DiaColloDB::threads::shared::MODULE
forks::shared
Bryan Jurish <moocow@cpan.org>
Copyright (C) 2020 by Bryan Jurish
This package is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.
DiaColloDB::threads(3pm), threads::shared(3pm), forks::shared(3pm), perl(1), ...
1 POD Error
The following errors were encountered while parsing the POD:
alternative text 'threads/shared.pm' contains non-escaped | or /
alternative text 'forks/shared.pm' contains non-escaped | or /
To install DiaColloDB, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DiaColloDB
CPAN shell
perl -MCPAN -e shell install DiaColloDB
For more information on module installation, please visit the detailed CPAN module installation guide.