?RCS:
?RCS: $Log: usethreads.U,v $
?RCS:
-?MAKE:usethreads useithreads use5005threads d_oldpthreads usereentrant: \
+?MAKE:usethreads useithreads d_oldpthreads usereentrant: \
Myread Oldconfig Setvar test cat
?MAKE: -pick add $@ %<
?Y:TOP
?S: and indicates that Perl should be built to use the interpreter-based
?S: threading implementation.
?S:.
-?S:use5005threads:
-?S: This variable conditionally defines the USE_5005THREADS symbol,
-?S: and indicates that Perl should be built to use the 5.005-based
-?S: threading implementation.
-?S:.
?X: I'm putting old_pthreads in this unit because it might eventually
?X: be part of an automatic determination to see if we can use threads
?X: at all.
?C: This symbol, if defined, indicates that Perl should be built to
?C: use the interpreter-based threading implementation.
?C:.
-?C:USE_5005THREADS:
-?C: This symbol, if defined, indicates that Perl should be built to
-?C: use the 5.005-based threading implementation.
-?C:.
?C:USE_THREADS:
?C: This symbol, if defined, indicates that Perl should
?C: be built to use threads. At present, it is a synonym for
-?C: USE_5005THREADS, but eventually the source ought to be changed
-?C: to use this to mean _any_ threading implementation.
+?C: and USE_ITHREADS, but eventually the source ought to be
+?C: changed to use this to mean _any_ threading implementation.
?C:.
?C:OLD_PTHREADS_API:
?C: This symbol, if defined, indicates that Perl should
?C: try to use the various _r versions of library functions.
?C: This is extremely experimental.
?C:.
-?H:#$use5005threads USE_5005THREADS /**/
?H:#$useithreads USE_ITHREADS /**/
-?H:?%<:#if defined(USE_5005THREADS) && !defined(USE_ITHREADS)
-?H:?%<:#define USE_THREADS /* until src is revised*/
-?H:?%<:#endif
+?H:#$usethreads USE_THREADS /**/
?H:#$d_oldpthreads OLD_PTHREADS_API /**/
?H:#$usereentrant USE_REENTRANT_API /**/
?H:.
-?LINT:set usethreads useithreads use5005threads d_oldpthreads usereentrant
+?LINT:set usethreads d_oldpthreads
?INIT:: set usethreads on the Configure command line to enable threads.
?INIT:usereentrant='undef'
?F:!usethreads.cbu
+: Do we want threads support and if so, what type
?X: We should really have some explanatory text here, and some
?X: automatic setting of sensible defaults.
case "$usethreads" in
$define|true|[yY]*) dflt='y';;
-*) # Catch case where user specified ithreads or 5005threads but
+*) # Catch case where user specified ithreads but
# forgot -Dusethreads (A.D. 4/2002)
- case "$useithreads$use5005threads" in
- *$define*) dflt='y' ;;
- *) dflt='n';;
+ case "$useithreads" in
+ *$define*) dflt='y';;
+ *) dflt='n';;
esac
;;
esac
cat <<EOM
-Perl can be built to take advantage of threads on some systems.
+Perl can be built to offer a form of threading support on some systems
To do so, Configure can be run with -Dusethreads.
Note that Perl built with threading support runs slightly slower
-and uses more memory than plain Perl. The current implementation
-is believed to be stable, but it is fairly new, and so should be
-treated with caution.
+and uses slightly more memory than plain Perl.
If this doesn't make any sense to you, just accept the default '$dflt'.
EOM
set usethreads
eval $setvar
-case "$usethreads" in
-$define)
- $cat <<EOM
-
-Since release 5.6, Perl has had two different threading implementations,
-the newer interpreter-based version (ithreads) with one interpreter per
-thread, and the older 5.005 version (5005threads).
-The 5005threads version is effectively unmaintained and will probably be
-removed in Perl 5.10, so there should be no need to build a Perl using it
-unless needed for backwards compatibility with some existing 5.005threads
-code.
+useithreads="$usethreads"
-EOM
- : Default to ithreads unless overridden on command line or with
- : old config.sh
- dflt='y'
- case "$use5005threads" in
- $define|true|[yY]*) dflt='n';;
- esac
- case "$useithreads" in
- $undef|false|[nN]*) dflt='n';;
- esac
- rp='Use the newer interpreter-based ithreads?'
- . ./myread
- case "$ans" in
- y|Y) val="$define" ;;
- *) val="$undef" ;;
- esac
- set useithreads
- eval $setvar
- : Now set use5005threads to the opposite value.
- case "$useithreads" in
- $define) val="$undef" ;;
- *) val="$define" ;;
- esac
- set use5005threads
- eval $setvar
- ;;
-*)
- useithreads="$undef"
- use5005threads="$undef"
- ;;
-esac
-
-?X: This is not supposed to be possible but with some trickery, maybe.
-case "$useithreads$use5005threads" in
-"$define$define")
- $cat >&4 <<EOM
-
-You cannot have both the ithreads and the 5.005 threads enabled
-at the same time. Disabling the 5.005 threads since they are
-much less stable than the ithreads.
-
-EOM
- use5005threads="$undef"
- ;;
-esac
-
-?X: Check out what kind of threads api we have
+?X: Check out what kind of threads API we have
case "$d_oldpthreads" in
'') : Configure tests would be welcome here. For now, assume undef.
val="$undef" ;;
?X: is present in libswanted. If that fails to be true, then this
?X: can be changed to add pthread to the very end of libswanted.
-case "$usethreads" in
-"$define"|true|[yY]*)
: Look for a hint-file generated 'call-back-unit'. If the
: user has specified that a threading perl is to be built,
: we may need to set or change some other defaults.
- if $test -f usethreads.cbu; then
- echo "Your platform has some specific hints for threaded builds, using them..."
- . ./usethreads.cbu
- else
+if $test -f usethreads.cbu; then
+ echo "Your platform has some specific hints regarding threaded builds, using them..."
+ . ./usethreads.cbu
+else
+ case "$usethreads" in
+ "$define"|true|[yY]*)
$cat <<EOM
-(Your platform doesn't have any specific hints for threaded builds.
+(Your platform does not have any specific hints for threaded builds.
Assuming POSIX threads, then.)
EOM
- fi
;;
-esac
+ esac
+fi