MCE::Ch...utexFast(3)
π NAME π
MCE::Channel::MutexFast β a fast channel for producer(s) and many consumers β¨
πΈ VERSION πΈ
This doc describes MCE::Channel::MutexFast version 1.902, bestie π
π¦ DESCRIPTION π¦
Okay so picture this: a channel class that gives you queue-like and two-way communication for processes and threads π«Ά All the locking? Handled for you using MCE::Mutex. No manual mutex wrangling, we love to see it.
This one is basically MCE::Channel::Mutex's cooler sibling, but optimized for non-Unicode strings only π The main glow-up difference: this module has no freeze-thaw serialization. Which means non-string arguments get stringified β yes, numbers and undef too, they're getting dragged into string form, no cap π
The API is described over in MCE::Channel, with the sole difference being that send and send2 handle one argument. That's it, that's the whole tea β
Current module available since MCE 1.877 π
β¨ new β¨
use MCE::Channel;
# The default is tuned for one producer and many consumers.
my $chnl_a = MCE::Channel->new( impl => 'MutexFast' );
# Specify the 'mp' option for safe use by two or more producers
# sending or receiving on the left side of the channel (i.e.
# ->enqueue/->send or ->recv2/->recv2_nb).
my $chnl_b = MCE::Channel->new( impl => 'MutexFast', mp => 1 );
Bestie listen β the default is tuned for one producer and many consumers. If you've got two or more producers sending or receiving on the left side of the channel (that's->enqueue/->sendor->recv2/->recv2_nb), you need to passmp => 1for safe use. Don't skip it, fr fr π
π QUEUE-LIKE BEHAVIOR π
The classic queue vibes, main character energy:
enqueuedequeuedequeue_nbend
π TWO-WAY IPC - PRODUCER TO CONSUMER π
Producer yaps, consumer listens π¬:
sendrecvrecv_nb
π TWO-WAY IPC - CONSUMER TO PRODUCER π
And now the consumer talks back, iconic behavior honestly:
send2recv2recv2_nb
π AUTHOR π
Mario E. Roy, <marioeroy AT gmail DOT com> π
That's the whole page, bestie β you ate that π
β¨ This doc came from the User Contributed Perl Documentation pages, perl v5.42.0, dated 2025-09-10, filed under MCE::Ch...utexFast(3). Go forth and channel your little heart out π¦π
π¦ where this page comes from
- fedora 43: perl-MCE 1.902-1.fc43 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms