1MCE::Channel::ThreadsFaUsste(r3)Contributed Perl DocumenMtCaEt:i:oCnhannel::ThreadsFast(3)
2
3
4
6 MCE::Channel::ThreadsFast - Fast channel for producer(s) and many
7 consumers
8
10 This document describes MCE::Channel::ThreadsFast version 1.889
11
13 A channel class providing queue-like and two-way communication for
14 threads only. Locking is handled using threads::shared.
15
16 This is similar to MCE::Channel::Threads but optimized for non-Unicode
17 strings only. The main difference is that this module lacks freeze-thaw
18 serialization. Non-string arguments become stringified; i.e. numbers
19 and undef.
20
21 The API is described in MCE::Channel with the sole difference being
22 "send" and "send2" handle one argument.
23
24 Current module available since MCE 1.877.
25
26 new
27 use MCE::Channel;
28
29 # The default is tuned for one producer and many consumers.
30 my $chnl_a = MCE::Channel->new( impl => 'ThreadsFast' );
31
32 # Specify the 'mp' option for safe use by two or more producers
33 # sending or receiving on the left side of the channel (i.e.
34 # ->enqueue/->send or ->recv2/->recv2_nb).
35
36 my $chnl_b = MCE::Channel->new( impl => 'ThreadsFast', mp => 1 );
37
39 enqueue
40 dequeue
41 dequeue_nb
42 end
43
45 send
46 recv
47 recv_nb
48
50 send2
51 recv2
52 recv2_nb
53
55 The t/04_channel_threads tests are disabled on Unix platforms for Perl
56 less than 5.10.1. Basically, the MCE::Channel::ThreadsFast
57 implementation is not supported on older Perls unless the OS vendor
58 applied upstream patches (i.e. works on RedHat/CentOS 5.x running Perl
59 5.8.x).
60
62 Mario E. Roy, <marioeroy AT gmail DOT com>
63
64
65
66perl v5.38.0 2023-09-14 MCE::Channel::ThreadsFast(3)