pthreadを使用すると、プログラムロジックにセカンダリスレッドを使用し、次を使用してスタックアドレスを設定できpthread_attr_setstack()
ます。
NAME
pthread_attr_setstack, pthread_attr_getstack - set/get stack
attributes in thread attributes object
SYNOPSIS
#include <pthread.h>
int pthread_attr_setstack(pthread_attr_t *attr,
void *stackaddr, size_t stacksize);
DESCRIPTION
The pthread_attr_setstack() function sets the stack address and
stack size attributes of the thread attributes object referred
to by attr to the values specified in stackaddr and stacksize,
respectively. These attributes specify the location and size
of the stack that should be used by a thread that is created
using the thread attributes object attr.
stackaddr should point to the lowest addressable byte of a buf‐
fer of stacksize bytes that was allocated by the caller. The
pages of the allocated buffer should be both readable and
writable.
私が従わないのは、このようなことを行うことでパフォーマンスの向上がどのように期待されるかです(「高速」メモリの目的はパフォーマンスの向上であると思います)。