* Copyright (c) 1996-1999 by Silicon Graphics. All rights reserved.
* Copyright (c) 1999-2011 by Hewlett-Packard Development Company.
-The file linux_threads.c is also
+The files pthread_stop_world.c and pthread_support.c are also
* Copyright (c) 1998 by Fergus Henderson. All rights reserved.
To enable debugging messages please do:
1) Add the "--enable-gc-debug" flag during configuration.
- 2) Edit the file linux-threads.c and uncomment the line:
-
- /* #define DEBUG_THREADS 1 */ to --->
-
- #define DEBUG_THREADS 1
-
- Then give "make" as usual.
+ 2) Pass "CFLAGS=-DDEBUG_THREADS" to "make".
In a machine with 4 CPUs (my own machine) the option parallel
mark (aka --enable-parallel-mark) makes a BIG difference.
(http://www.hpl.hp.com/techreports/2001/HPL-2001-251.html).
GC_RETRY_SIGNALS, GC_NO_RETRY_SIGNALS - Try to compensate for lost
- thread suspend signals in linux_threads.c. On by
+ thread suspend signals (Pthreads only). On by
default for GC_OSF1_THREADS, off otherwise. Note
that this does not work around a possible loss of
thread restart signals. This seems to be necessary for
In particular, it is very difficult for the collector to stop all other
threads in the system and examine the register contents. This is currently
accomplished with very different mechanisms for some Pthreads
-implementations. The Solaris implementation temporarily disables much
-of the user-level threads implementation by stopping kernel-level threads
-("lwp"s). The Linux/HPUX/OSF1 and Irix implementations sends signals to
+implementations. For Linux/HPUX/OSF1, Solaris and Irix it sends signals to
individual Pthreads and has them wait in the signal handler.
<P>
The Linux and Irix implementations use
only documented Pthreads calls, but rely on extensions to their semantics.
-The Linux implementation <TT>linux_threads.c</tt> relies on only very
+The Linux implementation <TT>pthread_stop_world.c</tt> relies on only very
mild extensions to the pthreads semantics, and already supports a large number
of other Unix-like pthreads implementations. Our goal is to make this the
only pthread support in the collector.
<P>
-(The Irix implementation is separate only for historical reasons and should
-clearly be merged. The current Solaris implementation probably performs
-better in the uniprocessor case, but does not support thread operations in the
-collector. Hence it cannot support the parallel marker.)
-<P>
All implementations must
intercept thread creation and a few other thread-specific calls to allow
enumeration of threads and location of thread stacks. This is current
# define ENTER_GC() GC_collecting = 1;
# define EXIT_GC() GC_collecting = 0;
GC_INNER void GC_lock(void);
-# endif /* GC_PTHREADS with linux_threads.c implementation */
+# endif /* GC_PTHREADS */
# ifdef GC_ALWAYS_MULTITHREADED
# define GC_need_to_lock TRUE
# else
* all flavors of pthread support code into this file.
*/
-/*
- * Linux_threads.c now also includes some code to support HPUX and
- * OSF1 (Compaq Tru64 Unix, really). The OSF1 support is based on Eric Benson's
- * patch.
- *
- * Eric also suggested an alternate basis for a lock implementation in
- * his code:
- * + #elif defined(OSF1)
- * + unsigned long GC_allocate_lock = 0;
- * + msemaphore GC_allocate_semaphore;
- * + # define GC_TRY_LOCK() \
- * + ((msem_lock(&GC_allocate_semaphore, MSEM_IF_NOWAIT) == 0) \
- * + ? (GC_allocate_lock = 1) \
- * + : 0)
- * + # define GC_LOCK_TAKEN GC_allocate_lock
- */
-
#if defined(GC_PTHREADS) && !defined(GC_WIN32_THREADS)
# include <stdlib.h>