Date: Sat, 18 Apr 2026 22:00:40 +0000 From: Po-Chuan Hsieh <sunpoet@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 7f4a79543252 - main - devel/p5-Atomic-Pipe: Add p5-Atomic-Pipe 0.023 Message-ID: <69e3ff08.33aa6.74a3b32a@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=7f4a795432528d90d517c3fe47d39e9a7be56b63 commit 7f4a795432528d90d517c3fe47d39e9a7be56b63 Author: Po-Chuan Hsieh <sunpoet@FreeBSD.org> AuthorDate: 2026-04-18 21:18:13 +0000 Commit: Po-Chuan Hsieh <sunpoet@FreeBSD.org> CommitDate: 2026-04-18 21:18:13 +0000 devel/p5-Atomic-Pipe: Add p5-Atomic-Pipe 0.023 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. --- devel/Makefile | 1 + devel/p5-Atomic-Pipe/Makefile | 21 +++++++++++++++++++++ devel/p5-Atomic-Pipe/distinfo | 3 +++ devel/p5-Atomic-Pipe/pkg-descr | 22 ++++++++++++++++++++++ devel/p5-Atomic-Pipe/pkg-plist | 2 ++ 5 files changed, 49 insertions(+) diff --git a/devel/Makefile b/devel/Makefile index 28d8be0b3225..95b6a0b86f96 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -1970,6 +1970,7 @@ SUBDIR += p5-Async-Interrupt SUBDIR += p5-Async-MergePoint SUBDIR += p5-AtExit + SUBDIR += p5-Atomic-Pipe SUBDIR += p5-Attribute-Handlers SUBDIR += p5-Attribute-Handlers-Prospective SUBDIR += p5-Attribute-Persistent diff --git a/devel/p5-Atomic-Pipe/Makefile b/devel/p5-Atomic-Pipe/Makefile new file mode 100644 index 000000000000..2e40dcc3af97 --- /dev/null +++ b/devel/p5-Atomic-Pipe/Makefile @@ -0,0 +1,21 @@ +PORTNAME= Atomic-Pipe +PORTVERSION= 0.023 +CATEGORIES= devel perl5 +MASTER_SITES= CPAN +MASTER_SITE_SUBDIR= CPAN:EXODIST +PKGNAMEPREFIX= p5- + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= Send atomic messages from multiple writers across a POSIX pipe +WWW= https://metacpan.org/dist/Atomic-Pipe + +LICENSE= ART10 GPLv1+ +LICENSE_COMB= dual +LICENSE_FILE_GPLv1+ = ${WRKSRC}/LICENSE + +USES= perl5 +USE_PERL5= configure + +NO_ARCH= yes + +.include <bsd.port.mk> diff --git a/devel/p5-Atomic-Pipe/distinfo b/devel/p5-Atomic-Pipe/distinfo new file mode 100644 index 000000000000..fb11b026bc5c --- /dev/null +++ b/devel/p5-Atomic-Pipe/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1775587090 +SHA256 (Atomic-Pipe-0.023.tar.gz) = ca72bccf0ace8032a58b17e58a416d4293f1c3442d5b5a0d893b27b491a8a688 +SIZE (Atomic-Pipe-0.023.tar.gz) = 37349 diff --git a/devel/p5-Atomic-Pipe/pkg-descr b/devel/p5-Atomic-Pipe/pkg-descr new file mode 100644 index 000000000000..e708bca4b46f --- /dev/null +++ b/devel/p5-Atomic-Pipe/pkg-descr @@ -0,0 +1,22 @@ +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. diff --git a/devel/p5-Atomic-Pipe/pkg-plist b/devel/p5-Atomic-Pipe/pkg-plist new file mode 100644 index 000000000000..89a8376d3346 --- /dev/null +++ b/devel/p5-Atomic-Pipe/pkg-plist @@ -0,0 +1,2 @@ +%%SITE_PERL%%/Atomic/Pipe.pm +%%PERL5_MAN3%%/Atomic::Pipe.3.gzhome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69e3ff08.33aa6.74a3b32a>
