LogoopenSUSE Build Service > Projects
Sign Up | Log In

Thread-safe queues

This module provides thread-safe FIFO queues that can be accessed safely by
any number of threads.

Any data types supported by the threads::shared manpage can be passed via

* Ordinary scalars

* Array refs

* Hash refs

* Scalar refs

* Objects based on the above

Ordinary scalars are added to queues as they are.

If not already thread-shared, the other complex data types will be cloned
(recursively, if needed, and including any 'bless'ings and read-only
settings) into thread-shared structures before being placed onto a queue.

For example, the following would cause the Thread::Queue manpage to create
a empty, shared array reference via '&shared([])', copy the elements 'foo',
'bar' and 'baz' from '@ary' into it, and then place that shared reference
onto the queue:

    my @ary = qw/foo bar baz/;

However, for the following, the items are already shared, so their
references are added directly to the queue, and no cloning takes place:

    my @ary :shared = qw/foo bar baz/;

    my $obj = &shared({});
    $$obj{'foo'} = 'bar';
    $$obj{'qux'} = 99;
    bless($obj, 'My::Class');

See the /"LIMITATIONS" manpage for caveats related to passing objects via

Source Files (show merged sources derived from linked package)

Filename Size Changed Actions
Thread-Queue-3.12.tar.gz 15 KB Download File
cpanspec.yml 469 Bytes Download File
perl-Thread-Queue-use_lib.patch 3.15 KB Download File
perl-Thread-Queue.changes 2.32 KB Download File
perl-Thread-Queue.spec 2.82 KB Download File

Comments for home:jayvdb:autotools (0)

Login required, please login or signup in order to comment