pthreads を使用すると、ユーザーはスレッド スタックに使用するメモリのチャンクを提供できます。
size_t stack_size = 1024*1024*4;
void *stack = malloc( stack_size );
pthread_attr_t attributes;
pthread_attr_init( &attributes );
pthread_attr_setstack( &attributes, stack, stack_size );
pthread_t thread_id;
pthread_create( &thread_id, &attributes, worker_function, NULL
Windows スレッドは同様の機能を提供しますか? CreateThreadの 2 番目のパラメーターを使用すると、スタックの最小サイズを指定できますが、使用するバッファーのアドレスを指定する方法がわかりません。