ports/104325: [NEW PORT] devel/p5-forks: Drop-in replacement for Perl threads using fork()

Cheng-Lung Sung clsung at FreeBSD.org
Thu Oct 12 07:10:18 UTC 2006


>Number:         104325
>Category:       ports
>Synopsis:       [NEW PORT] devel/p5-forks: Drop-in replacement for Perl threads using fork()
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Thu Oct 12 07:10:16 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Cheng-Lung Sung
>Release:        FreeBSD 6.2-PRERELEASE i386
>Organization:
FreeBSD @ Taiwan
>Environment:
System: FreeBSD going04.iis.sinica.edu.tw 6.2-PRERELEASE FreeBSD 6.2-PRERELEASE #21: Wed Sep 13 17:54:15 CST 2006
>Description:
The "forks" pragma allows a developer to use threads without having to 
have a threaded perl, or to even run 5.8.0 or higher. There were a number 
of goals that I am trying to reach with this implementation.

The standard Perl 5.8.0 threads implementation is very memory consuming, 
which makes it basically impossible to use in a production environment, 
particularly with mod_perl and Apache. Because of the use of the standard 
Unix fork() capabilities, most operating systems will be able to use the 
Copy-On-Write (COW) memory sharing capabilities (whereas with the standard 
Perl 5.8.0 threads implementation, this is thwarted by the Perl interpreter 
cloning process that is used to create threads). The memory savings have 
been confirmed.

You should be able to run threaded applications unchanged by simply making 
sure that the "forks" and "forks::shared" modules are loaded, 
e.g. by specifying them on the command line.

WWW:	http://search.cpan.org/dist/forks/

Generated with FreeBSD Port Tools 0.77
>How-To-Repeat:
>Fix:

--- p5-forks-0.20.shar begins here ---
# This is a shell archive.  Save it in a file, remove anything before
# this line, and then unpack it by entering "sh file".  Note, it may
# create directories; files and directories will be owned by you and
# have default permissions.
#
# This archive contains:
#
#	p5-forks
#	p5-forks/pkg-descr
#	p5-forks/Makefile
#	p5-forks/pkg-plist
#	p5-forks/distinfo
#
echo c - p5-forks
mkdir -p p5-forks > /dev/null 2>&1
echo x - p5-forks/pkg-descr
sed 's/^X//' >p5-forks/pkg-descr << 'END-of-p5-forks/pkg-descr'
XThe "forks" pragma allows a developer to use threads without having to 
Xhave a threaded perl, or to even run 5.8.0 or higher. There were a number 
Xof goals that I am trying to reach with this implementation.
X
XThe standard Perl 5.8.0 threads implementation is very memory consuming, 
Xwhich makes it basically impossible to use in a production environment, 
Xparticularly with mod_perl and Apache. Because of the use of the standard 
XUnix fork() capabilities, most operating systems will be able to use the 
XCopy-On-Write (COW) memory sharing capabilities (whereas with the standard 
XPerl 5.8.0 threads implementation, this is thwarted by the Perl interpreter 
Xcloning process that is used to create threads). The memory savings have 
Xbeen confirmed.
X
XYou should be able to run threaded applications unchanged by simply making 
Xsure that the "forks" and "forks::shared" modules are loaded, 
Xe.g. by specifying them on the command line.
X
XWWW:	http://search.cpan.org/dist/forks/
END-of-p5-forks/pkg-descr
echo x - p5-forks/Makefile
sed 's/^X//' >p5-forks/Makefile << 'END-of-p5-forks/Makefile'
X# New ports collection makefile for:	p5-forks
X# Date created:		2006-10-12
X# Whom:			Cheng-Lung Sung <clsung at FreeBSD.org>
X#
X# $FreeBSD$
X#
X
XPORTNAME=	forks
XPORTVERSION=	0.20
XCATEGORIES=	devel perl5
XMASTER_SITES=	${MASTER_SITE_PERL_CPAN}
XMASTER_SITE_SUBDIR=	../../authors/id/R/RY/RYBSKEJ
XPKGNAMEPREFIX=	p5-
X
XMAINTAINER=	clsung at FreeBSD.org
XCOMMENT=	Drop-in replacement for Perl threads using fork()
X
XRUN_DEPENDS=	${SITE_PERL}/reaper.pm:${PORTSDIR}/devel/p5-reaper
XBUILD_DEPENDS=	${RUN_DEPENDS}
X
XPERL_CONFIGURE=	yes
X
XMAN3=		forks.3 forks::shared.3 \
X		threads::shared::array.3 \
X		threads::shared::handle.3 \
X		threads::shared::hash.3 \
X		threads::shared::scalar.3
X
X.include <bsd.port.pre.mk>
X
X.if ${PERL_LEVEL} < 500600
XIGNORE=		requires perl 5.6.0 or later. Install lang/perl5.8 then try again
X.endif
X
X.if ${PERL_LEVEL} < 500702
XRUN_DEPENDS+=	${SITE_PERL}/${PERL_ARCH}/Scalar/Util.pm:${PORTSDIR}/lang/p5-Scalar-List-Utils
X.endif
X
X.include <bsd.port.post.mk>
END-of-p5-forks/Makefile
echo x - p5-forks/pkg-plist
sed 's/^X//' >p5-forks/pkg-plist << 'END-of-p5-forks/pkg-plist'
X%%SITE_PERL%%/%%PERL_ARCH%%/auto/forks/.packlist
X%%SITE_PERL%%/%%PERL_ARCH%%/auto/forks/forks.bs
X%%SITE_PERL%%/%%PERL_ARCH%%/auto/forks/forks.so
X%%SITE_PERL%%/%%PERL_ARCH%%/forks.pm
X%%SITE_PERL%%/%%PERL_ARCH%%/forks/shared.pm
X%%SITE_PERL%%/%%PERL_ARCH%%/threads/shared/array.pm
X%%SITE_PERL%%/%%PERL_ARCH%%/threads/shared/handle.pm
X%%SITE_PERL%%/%%PERL_ARCH%%/threads/shared/hash.pm
X%%SITE_PERL%%/%%PERL_ARCH%%/threads/shared/scalar.pm
X at dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/auto/forks
X at dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/forks
X at dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/threads/shared
X at dirrmtry %%SITE_PERL%%/%%PERL_ARCH%%/threads
END-of-p5-forks/pkg-plist
echo x - p5-forks/distinfo
sed 's/^X//' >p5-forks/distinfo << 'END-of-p5-forks/distinfo'
XMD5 (forks-0.20.tar.gz) = 6127fa9c45428ead0d74df2eec9b3854
XSHA256 (forks-0.20.tar.gz) = 1f8575054aa148fd341a381dfd98b0d368d1d976699c8540c435911206198c0d
XSIZE (forks-0.20.tar.gz) = 70254
END-of-p5-forks/distinfo
exit
--- p5-forks-0.20.shar ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list