NOTE: This documentation describes the style of threading that was
-available in 5.005. Perl v5.6 also has the early beginnings of
-interpreter-based threads support (which is what will be enabled by
-default when you simply ask for -Dusethreads). However, be advised
-that interpreter threads cannot as yet be created from the Perl level
-yet. If you're looking to create threads from within Perl, chances
-are you _don't_ want interpreter threads, but want the older support
-for threads described below, enabled with:
+available in Perl 5.005. Perl 5.6.0 introduced the early beginnings of
+interpreter-based threads support, also known as ithreads, and in Perl
+5.8.0 the interpeter threads became available from perl level through
+the threads and threads::shared modules (in Perl 5.6 ithreads are
+available only internally and to XS extension builders, and used
+by the Win32 port for emulating fork()). As of Perl 5.8.0, ithreads has
+become the standard threading model for Perl.
+
+If you really want the older support for threads described below,
+it is enabled with:
sh Configure -Dusethreads -Duse5005threads
+Be warned that the old 5.005 implementation of threads is known
+to be quite buggy, and unmaintained, which means that the bugs
+are there to stay. (We are not mean by not fixing the bugs:
+the bugs are just really, really, really hard to fix. Honest.)
+
The rest of this document only applies to the use5005threads style of
-threads.
+threads, and the comments on what works on which platform are highly
+obsolete and preserved here for archaeology buffs only. The
+architecture specific hints files do all the necessary option
+tweaking automatically during Configure, both for the 5.005 threads
+and for the new interpreter threads.
+
---------------------------------------------------------------------------
Support for threading is still in the highly experimental stages. There
* OpenBSD
- * NeXTstep, OpenStep (Rhapsody?)
+ * NeXTstep, OpenStep
* OS/2
Add -lpthread -lc_r to lddlflags
For some reason, the extra includes for pthreads make Digital UNIX
- complain fatally about the sbrk() delcaration in perl's malloc.c
+ complain fatally about the sbrk() declaration in perl's malloc.c
so use the native malloc, e.g. sh Configure -Uusemymalloc, or
manually edit your config.sh as follows:
Change usemymalloc to n
make
When you succeed in compiling and testing ("make test" after your
-build) a threaded Perl in a platform previosuly unknown to support
+build) a threaded Perl in a platform previously unknown to support
threaded perl, please let perlbug@perl.com know about your victory.
Explain what you did in painful detail.
hack I did to grab a bit of extra information from segfaults.
If you have a fancier gdb/threads setup than I do then you'll
have to delete the lines in perl.c which say
- #if defined(DEBUGGING) && defined(USE_THREADS) && defined(__linux__)
+ #if defined(DEBUGGING) && defined(USE_5005THREADS) && defined(__linux__)
DEBUG_S(signal(SIGSEGV, (void(*)(int))catch_sigsegv););
#endif
implementation of condition variables in certain porting situations.)
For POSIX threads, perl mutexes and condition variables correspond to
POSIX ones. For FAKE_THREADS, mutexes are stubs and condition variables
-are implmented as lists of waiting threads. For FAKE_THREADS, a thread
+are implemented as lists of waiting threads. For FAKE_THREADS, a thread
waits on a condition variable by removing itself from the runnable
list, calling SCHEDULE to change thr to the next appropriate
runnable thread and returning op (i.e. the new threads next op).