GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Specific(3) User Contributed Perl Documentation Specific(3)

Coro::Specific - manage coroutine-specific variables.

 use Coro::Specific;

 my $ref = new Coro::Specific;

 $$ref = 5;
 print $$ref;

This module can be used to create variables (or better: references to them) that are specific to the currently executing coroutine. This module does not automatically load the Coro module (so the overhead will be small when no coroutines are used).

A much faster method is to store extra keys into %$Coro::current - all you have to do is to make sure that the key is unique (e.g. by prefixing it with your module name). You can even store data there before loading the Coro module - when Coro is loaded, the keys stored in %$Coro::current are automatically attached to the coro thread executing the main program.

You don't have to load "Coro::Specific" manually, it will be loaded automatically when you "use Coro" and call the "new" constructor.

new
Create a new coroutine-specific scalar and return a reference to it. The scalar is guaranteed to be "undef". Once such a scalar has been allocated you cannot deallocate it (yet), so allocate only when you must.

The actual coroutine specific values do not automatically get destroyed when the Coro::Specific object gets destroyed.

   Marc A. Lehmann <schmorp@schmorp.de>
   http://software.schmorp.de/pkg/Coro.html
2020-07-29 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.