BSD Ports

devel/p5-Atomic-Pipe 0.032 FreeBSD

Send atomic messages from multiple writers across a POSIX pipe

System
FreeBSD
Repository
FreeBSD ports
Maintainer
[email protected]
Last update
Commit
cb2adb934d
License
ART10, GPLv1+
Categories
devel, perl5
Package size
36.3 KiB, 95.6 KiB installed

Description

Normally if you write to a pipe from multiple processes/threads, the messages will come mixed together unpredictably. Some messages may be interrupted by parts of messages from other writers. This module takes advantage of some POSIX specifications to allow multiple writers to send arbitrary data down a pipe in atomic chunks to avoid the issue.

NOTE: This only works for POSIX compliant pipes on POSIX compliant systems. Also some features may not be available on older systems, or some platforms.

Under the hood this module will split your message into small sections of slightly smaller than the PIPE_BUF limit. Each message will be sent as 1 atomic chunk with a 4 byte prefix indicating what process id it came from, what thread id it came from, a chunk ID (in descending order, so if there are 3 chunks the first will have id 2, the second 1, and the final chunk is always 0 allowing a flush as it knows it is done) and then 1 byte with the length of the data section to follow.

On the receiving end this module will read chunks and re-assemble them based on the header data. So the reader will always get complete messages. Note that message order is not guarenteed when messages are sent from multiple processes or threads. Though all messages from any given thread/process should be in order.

In the other systems

SystemPortVersion
FreeBSDdevel/p5-Atomic-Pipe0.032
HardenedBSDdevel/p5-Atomic-Pipe0.032
GhostBSDdevel/p5-Atomic-Pipe0.032

Install

Binary package:

pkg install p5-Atomic-Pipe

From the ports tree:

cd /usr/ports/devel/p5-Atomic-Pipe/ && make install clean

To depend on this port in another port's Makefile:

RUN_DEPENDS=	p5-Atomic-Pipe>0:devel/p5-Atomic-Pipe

Packages

The version each package repository carries. “-” means the repository builds no package of it, “n/a” that there is no such repository.

Repositoryaarch64amd64armv6armv7i386
FreeBSD:14:latest0.0320.032--0.032
FreeBSD:14:quarterly0.0320.032n/a-0.032
FreeBSD:15:latest0.0320.032n/a--
FreeBSD:15:quarterly0.0320.032n/an/an/a
FreeBSD:16:latest0.0320.032n/an/an/a
FreeBSD:16:quarterlyn/an/an/an/an/a

Dependencies

As this port's Makefile names them.

Test 1

  • py-Test-Simple>=1.302200 : devel/py-Test-Simple

The full lists below include those, and their dependencies in turn.

Build dependencies 2
Run dependencies 2

No port depends on this one.

Configuration

Options name: devel_Atomic-Pipe

OptionDefaultDescription
RECOMMENDEDonRecommended dependencies by upstream
USES
perl5
Service scripts
none

Files

pkg-plist 2
  • %%SITE_PERL%%/Atomic/Pipe.pm
  • %%PERL5_MAN3%%/Atomic::Pipe.3.gz
distinfo 1
FileSizeSHA256
Atomic-Pipe-0.032.tar.gz66065d8ea0f2b1397e99e5c87607ad44068549b6c80db0b37a517215df7ad2b752006
Master sites 1
  • CPAN

Commit history 1

DateCommitCreditsLog message
cb2adb934d Po-Chuan Hsieh devel/p5-Atomic-Pipe: Update to 0.032
Changes: https://metacpan.org/dist/Atomic-Pipe/changes