MCE::Ch...:Threads(3)
π MCE::Channel::Threads(3) β the manual page, bestie edition π
okay so this is the user-contributed Perl documentation for MCE::Channel::Threads, and I'm gonna walk you through it like we're texting at 1am. buckle up π
β¨ NAME β¨
MCE::Channel::Threads β a Channel for producer(s) and many consumers. it's giving assembly line but make it threads π§΅
πΈ VERSION πΈ
This document describes MCE::Channel::Threads version 1.902. yes, the version number is exact, don't @ me π
π¦ DESCRIPTION π¦
So basically, this is a channel class that gives you queue-like and two-way communication, but for threads only. no processes allowed at this party π
Locking? handled using threads::shared. she does her own security, iconic behavior honestly π
The API is described in MCE::Channel β go read that for the full tea.
π new
use MCE::Channel;
# The default is tuned for one producer and many consumers.
my $chnl_a = MCE::Channel->new( impl => 'Threads' );
# 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 => 'Threads', mp => 1 );
okay so real talk about those comments, because they MATTER:
- the default setup is tuned for one producer and many consumers. one queen, many loyal subjects β¨
- but if you've got two or more producers sending or receiving on the left side of the channel, you gotta pass
mp => 1. and by "left side" we mean->enqueue/->sendor->recv2/->recv2_nb. do not skip this, bestie, it's the safety rail π«Ά
π QUEUE-LIKE BEHAVIOR π
these are the queue-girlies, in order:
enqueuedequeuedequeue_nbend
π₯ TWO-WAY IPC - PRODUCER TO CONSUMER π₯
the producer-to-consumer pipeline, main character energy:
sendrecvrecv_nb
π TWO-WAY IPC - CONSUMER TO PRODUCER π
and the reply lane, consumer hitting back:
send2recv2recv2_nb
π LIMITATIONS π
okay here's the part where we gotta be real. the t/04_channel_threads tests are disabled on Unix platforms for Perl less than 5.10.1. basically, the MCE::Channel::Threads implementation is not supported on older Perls unless the OS vendor applied upstream patches. (like, it works on RedHat/CentOS 5.x running Perl 5.8.x. yes, for real. vintage behavior π)
lowkey important: older Perl = no support unless patched upstream. that's the whole vibe. no cap.
π AUTHOR π
Mario E. Roy, <marioeroy AT gmail DOT com> β the icon, the legend, the one who wrote this β¨
that's the whole page bestie, you understood it perfectly, slay π
this was perl v5.42.0, dated 2025-09-10, straight from MCE::Ch...:Threads(3) β see you in the next manpage, mwah π«Άπ
π¦ 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