]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use growable stacks for thread stacks that are the default stack size.
authorjasone <jasone@FreeBSD.org>
Mon, 5 Jul 1999 00:35:19 +0000 (00:35 +0000)
committerjasone <jasone@FreeBSD.org>
Mon, 5 Jul 1999 00:35:19 +0000 (00:35 +0000)
commit6f85900affc95409ce87ebfce319b6f0a911a95c
tree55bd23172185419206e51b736aeb4824ee2c7666
parenta84623740cbcddc83d3ae0e49ad184b469302d78
Use growable stacks for thread stacks that are the default stack size.

Cache discarded default thread stacks for use in subsequent thread creations.

Create a red zone at the end of each stack (including the initial thread
stack), with the hope of causing a segfault if a stack overflows.

To activate these modifications, add -D_PTHREAD_GSTACK to CFLAGS in
src/lib/libc_r/Makefile.  Since the modifications depend on the VM_STACK
kernel option, I'm not sure how to safely use growable stacks by default.

Testing, as well as algorithmic and stylistic comments are welcome.
14 files changed:
lib/libc_r/Makefile
lib/libc_r/uthread/pthread_private.h
lib/libc_r/uthread/uthread_create.c
lib/libc_r/uthread/uthread_gc.c
lib/libc_r/uthread/uthread_init.c
lib/libkse/Makefile
lib/libkse/thread/thr_create.c
lib/libkse/thread/thr_init.c
lib/libkse/thread/thr_private.h
lib/libpthread/Makefile
lib/libpthread/thread/thr_create.c
lib/libpthread/thread/thr_gc.c
lib/libpthread/thread/thr_init.c
lib/libpthread/thread/thr_private.h