1MCE::Channel::Mutex(3)User Contributed Perl DocumentationMCE::Channel::Mutex(3)
2
3
4
6 MCE::Channel::Mutex - Channel for producer(s) and many consumers
7
9 This document describes MCE::Channel::Mutex version 1.889
10
12 A channel class providing queue-like and two-way communication for
13 processes and threads. Locking is handled using MCE::Mutex.
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 => 'Mutex' );
22
23 # Specify the 'mp' option for safe use by two or more producers
24 # sending or receiving 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 => 'Mutex', 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 Mario E. Roy, <marioeroy AT gmail DOT com>
47
48
49
50perl v5.38.0 2023-09-14 MCE::Channel::Mutex(3)