INIT_REAL_SYMS(); /* for pthread_create */
if (0 != pthread_attr_init(&attr)) ABORT("pthread_attr_init failed");
-
if (0 != pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED))
ABORT("pthread_attr_setdetachstate failed");
break;
}
}
- GC_COND_LOG_PRINTF("Started %d mark helper threads\n", GC_markers_m1);
pthread_attr_destroy(&attr);
+ GC_COND_LOG_PRINTF("Started %d mark helper threads\n", GC_markers_m1);
}
#endif /* PARALLEL_MARK */
}
# endif
}
+ GC_COND_LOG_PRINTF("Number of processors = %d\n", GC_nprocs);
# ifdef PARALLEL_MARK
- GC_COND_LOG_PRINTF("Number of processors = %d,"
- " number of marker threads = %d\n",
- GC_nprocs, GC_markers_m1 + 1);
if (GC_markers_m1 <= 0) {
/* Disable parallel marking. */
GC_parallel = FALSE;
/* If we are using a parallel marker, actually start helper threads. */
start_mark_threads();
}
-# else
- GC_COND_LOG_PRINTF("Number of processors = %d\n", GC_nprocs);
# endif
}
# define NUMERIC_THREAD_ID(id) (unsigned long)GC_PTHREAD_PTRVAL(id)
# endif
- /* start_mark_threads() is the same as in pthread_support.c except for: */
- /* - GC_markers_m1 value is adjusted already; */
- /* - thread stack is assumed to be large enough; and */
- /* - statistics about the number of marker threads is printed outside. */
+ /* start_mark_threads is the same as in pthread_support.c except */
+ /* for thread stack that is assumed to be large enough. */
static void start_mark_threads(void)
{
int i;
pthread_t new_thread;
if (0 != pthread_attr_init(&attr)) ABORT("pthread_attr_init failed");
-
if (0 != pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED))
ABORT("pthread_attr_setdetachstate failed");
}
}
pthread_attr_destroy(&attr);
+ GC_COND_LOG_PRINTF("Started %d mark helper threads\n", GC_markers_m1);
}
static pthread_mutex_t mark_mutex = PTHREAD_MUTEX_INITIALIZER;
# else
GC_markers_m1 = i;
# endif
+ GC_COND_LOG_PRINTF("Started %d mark helper threads\n", GC_markers_m1);
if (i == 0) {
CloseHandle(mark_cv);
CloseHandle(builder_cv);
) {
/* Disable parallel marking. */
GC_parallel = FALSE;
+ GC_COND_LOG_PRINTF(
+ "Single marker thread, turning off parallel marking\n");
} else {
# ifndef GC_PTHREADS_PARAMARK
/* Initialize Win32 event objects for parallel marking. */
GC_register_my_thread_inner(&sb, GC_main_thread);
# ifdef PARALLEL_MARK
- /* If we are using a parallel marker, actually start helper threads. */
- if (GC_parallel) start_mark_threads();
- GC_COND_LOG_PRINTF("Started %d mark helper threads\n", GC_markers_m1);
+ if (GC_parallel)
+ {
+ /* If we are using a parallel marker, actually start helper threads. */
+ start_mark_threads();
+ }
# endif
}