MCE::Ch...eadsFast(3)

πŸ’– MCE::Channel::ThreadsFast πŸ’–

okay so bestie, you found the manual page for MCE::Channel::ThreadsFast β€” that's a thing from User Contributed Perl Documentation, and it is genuinely one of those little modules that eats. pull up a chair, we're doing this together 🫢


✨ NAME ✨

MCE::Channel::ThreadsFast β€” a fast channel for producer(s) and many consumers. no cap. πŸ’…


🌸 VERSION 🌸

this doc describes MCE::Channel::ThreadsFast version 1.902. write it down, bestie, we love a version number. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

so like, this is a channel class that gives you queue-like behavior and two-way communication β€” but for threads only, periodt. the locking? handled with threads::shared. she's lowkey self-sufficient like that. 😌

it's basically the same vibe as MCE::Channel::Threads, except this one is optimized for non-Unicode strings only. the main difference: this module lacks freeze-thaw serialization. non-string arguments get stringified β€” so, like, numbers and undef. it's giving "we said strings, we meant strings." πŸ’€

the API is described over in MCE::Channel, with the sole difference being that "send" and "send2" handle one argument.

this current module has been available since MCE 1.877. iconic.

🌈 new

use MCE::Channel;

# The default is tuned for one producer and many consumers.
my $chnl_a = MCE::Channel->new( impl => 'ThreadsFast' );

# 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 => 'ThreadsFast', mp => 1 );

πŸŽ€ QUEUE-LIKE BEHAVIOR πŸŽ€

  • enqueue
  • dequeue
  • dequeue_nb
  • end

πŸ’œ TWO-WAY IPC - PRODUCER TO CONSUMER πŸ’œ

  • send
  • recv
  • recv_nb

πŸ“ TWO-WAY IPC - CONSUMER TO PRODUCER πŸ“

  • send2
  • recv2
  • recv2_nb

🧚 LIMITATIONS 🧚

okay so listen closely, this part matters bestie.

the t/04_channel_threads tests are disabled on Unix platforms for Perl less than 5.10.1. basically, the MCE::Channel::ThreadsFast 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. so don't come for her if your Perl is ancient. 😭


πŸ‘‘ AUTHOR πŸ‘‘

Mario E. Roy, <marioeroy AT gmail DOT com> β€” the icon who wrote all this. we stan. 🌟


perl v5.42.0 Β· 2025-09-10 Β· and that's the whole MCE::Ch...eadsFast(3) page, bestie β€” go forth and thread safely, ily, bye πŸ’–βœ¨πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from