1MCE::Channel::Threads(3U)ser Contributed Perl DocumentatiMoCnE::Channel::Threads(3)
2
3
4
6 MCE::Channel::Threads - Channel for producer(s) and many consumers
7
9 This document describes MCE::Channel::Threads version 1.879
10
12 A channel class providing queue-like and two-way communication for
13 threads only. Locking is handled using threads::shared.
14
15 The API is described in MCE::Channel.
16
17 new
18 use MCE::Channel;
19
20 # The default is tuned for one producer and many consumers.
21 my $chnl_a = MCE::Channel->new( impl => 'Threads' );
22
23 # Specify the 'mp' option for safe use by two or more producers
24 # sending or recieving on the left side of the channel (i.e.
25 # ->enqueue/->send or ->recv2/->recv2_nb).
26
27 my $chnl_b = MCE::Channel->new( impl => 'Threads', mp => 1 );
28
30 enqueue
31 dequeue
32 dequeue_nb
33 end
34
36 send
37 recv
38 recv_nb
39
41 send2
42 recv2
43 recv2_nb
44
46 The t/04_channel_threads tests are disabled on Unix platforms for Perl
47 less than 5.10.1. Basically, the MCE::Channel::Threads implementation
48 is not supported on older Perls unless the OS vendor applied upstream
49 patches (i.e. works on RedHat/CentOS 5.x running Perl 5.8.x).
50
52 Mario E. Roy, <marioeroy AT gmail DOT com>
53
54
55
56perl v5.36.0 2022-07-22 MCE::Channel::Threads(3)