MCE::Channel::MutexFast(3pm)

MCE::Channel::MutexFast3pm

Fast channel for producer(s) and many consumers

Version

This document describes MCE::Channel::MutexFast version 1.901

Overview

A channel class providing queue-like and two-way communication for processes and threads. Locking is handled using MCE::Mutex.

This is similar to MCE::Channel::Mutex but optimized for non-Unicode strings only. The main difference is that this module lacks freeze-thaw serialization. Non-string arguments become stringified; i.e. numbers and undef.

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

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 );

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

Releases

2 releases since Debian 12 (Bookworm); the text changed 1 time.

  1. 12
  2. 13

Author

Mario E. Roy, <marioeroy AT gmail DOT com>

From libmce-perl 1.901-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.