• Home
  • Most Popular
  • Submit
  • About Us
  • Contact Us

Softpile

Free Downloads

Categories
  • Home
  • Most Popular
  • Communications
  • Desktop
  • Games & Entertainment
  • Graphic Apps
  • Network & Internet
  • Security & Privacy
  • System Utilities
Alternative to itextsharp 2022.11.10347
IronPDF offers an itextsharp alternative for HTML to PDF conversion with C# code examples, documentation, and ...
VShell Server for Linux and Mac 4.8
VShell is a versatile and secure file transfer server that supports multiple protocols and is compatible ...
PDF Studio PDF Editor for Linux 2022
PDF Studio is a cost-effective PDF editor that delivers full compatibility with the PDF Standard. It's ...
VQ Probe for Linux 1.5
VQ Probe is a comprehensive software tool that enables objective and subjective video quality analysis. The ...
Resilient Server 2.3
This Debian GNU/Linux (Buster) based software has a customized partitioning scheme that enhances robustness against filesystem ...
Valentina Studio for Linux 9.6
Valentina Studio is a cross-platform GUI manager for Mac, Windows, and Linux. It allows users to ...
VPN Lifeguard for Linux 1.0.58
The software monitors VPN connection and automatically terminates apps during connection loss, re-establishes the connection and ...
G_Viewer 0.84
G_Viewer is a Linux software that serves as both a file system and photo/image viewer. It ...
Checksome File Hash Tool for Linux 1.1
This software allows for the generation and verification of file hashes. It is a quick and ...
KeyWrangler Password Manager for Linux 1.2
A password management software that is secure, offline and extensible. It offers military-grade encryption to protect ...
Home Linux threads::shared Download

threads::shared

September 7, 2009
This is a Perl extension that facilitates the sharing of data structures among threads. It enables multiple threads to access a shared data structure simultaneously while minimizing the risk of data corruption or race condition.
Version 1.31
License Perl Artistic License
Platform Linux
Supported Languages English
Homepage search.cpan.org
Developed by Jerry D. Hedden
If you're looking for a way to share variables across different threads or processes, look no further than threads::shared. This powerful Perl module allows you to share scalars and scalar refs, arrays and array refs, and hashes and hash refs between threads and pseudo-forks on Win32.

To get started with threads::shared, simply include it in your project like you would any other module. Then, declare the variables you want to share by adding the :shared tag to their declaration, like so:

my $var :shared;
my %hsh :shared;
my @ary :shared;

After declaring your variables, use the share() function to make them shareable:

share($scalar);
share(@array);
share(%hash);

Once your variables are set up for sharing, you can access and modify them using standard Perl syntax. For example:

$var = $scalar_value;
$var = $shared_ref_value;
$var = shared_clone($non_shared_ref_value);
$var = shared_clone({'foo' => [qw/foo bar baz/]});

Note that you can also share complex data structures by using shared_clone().

In addition to standard variable access, threads::shared provides several synchronization mechanisms to ensure safe access to shared variables. For example, you can use the lock() function to lock a hash for exclusive access:

{ lock(%hash); ... }

Or you can use the cond_wait(), cond_timedwait(), cond_broadcast(), and cond_signal() functions to coordinate access between threads.

Finally, if you need to synchronize access to a specific variable, you can use a separate lock variable with cond_wait() and cond_timedwait():

my $lockvar :shared;
# condition var != lock var
cond_wait($var, $lockvar);
cond_timedwait($var, time()+30, $lockvar);

Overall, threads::shared is an incredibly useful module for any Perl developer who needs to share variables between threads or processes. Its simple syntax and powerful synchronization features make it a must-have tool for concurrency programming.
What's New

Version 1.31: N/A

Free Download 83.7K
316
  • Share on:

Most Popular

  1. Quicksilver Forums 1.4.2
    154
  2. Dvgrab 3.4
    102
  3. DynVPN 1.0
    89
  4. CherryTV 0.1
    81
  5. SlideMap 1.2.2
    80
  6. porm r2
    73
  7. Clewarecontrol 0.8
    72
  8. Java Games 1.0
    72
  9. Swiftfox 3.0b5pre-2
    71
  10. fuseftp 0.8
    71

Related Downloads

Dual Core System Monitor with Amarok
This software is a Superkarmaba theme that monitors a dual core system ...
Kamel
Kamel is a Gnome icon theme.
C++ MudBase
C++ MudBase is a basic mud-related software with potential to be expanded ...
Bibble Professional
Bibble sets a new benchmark in Raw Workflow software.
Webacula
Webacula is an interface that allows users to access Bacula backup system ...
AMD Power Monitor 64-bit SLES 9
The software monitors AMD processor frequency, voltage, utilization, and power savings.
MySmartCI
MySmartCI is an easy-to-use command interpreter that supports Python module extensions. It ...
MooseX::Has::Sugar
The Sugar Syntax software allows for the creation of fields in moose.
Tk::CanvasLogo
This software features a Tk::Canvas widget that enables multiple turtles and supports ...
xmlconf-lite
Xmlconf-lite is a lightweight library for reading and writing XML configuration files, ...
Copyright © 1999-2025 Softpile Free Downloads
  • Most Popular
  • Submit
  • About Us
  • Contact Us
  • Privacy Policy
  • Disclaimer
  • Terms of Use

Can we use your data to tailor ads for you?

Our partners will collect data and use cookies for ad personalization and measurement.

By choosing "I agree", closing this pop-up or clicking on any element on the page, you agree to the use of cookies to help us provide you with a better user experience.

Learn how Softpile and our partners collect and use data.

You can change your choice at any time in our privacy center.

Cookie Settings

Our website stores four types of cookies. At any time you can choose which cookies you accept and which you refuse. You can read more about what cookies are and what types of cookies we store in our Cookie Policy.

are necessary for technical reasons. Without them, this website may not function properly.

are necessary for specific functionality on the website. Without them, some features may be disabled.

allow us to analyse website use and to improve the visitor's experience.

allow us to personalise your experience and to send you relevant content and offers, on this website and other websites.