1MCE::Channel::MutexFastU(s3e)r Contributed Perl DocumentaMtCiEo:n:Channel::MutexFast(3)
2
3
4
6 MCE::Channel::MutexFast - Fast channel for producer(s) and many
7 consumers
8
10 This document describes MCE::Channel::MutexFast version 1.878
11
13 A channel class providing queue-like and two-way communication for
14 processes and threads. Locking is handled using MCE::Mutex.
15
16 This is similar to MCE::Channel::Mutex 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 => 'MutexFast' );
31
32 # Specify the 'mp' option for safe use by two or more producers
33 # sending or recieving 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 => 'MutexFast', 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 Mario E. Roy, <marioeroy AT gmail DOT com>
56
57
58
59perl v5.34.0 2022-02-20 MCE::Channel::MutexFast(3)