Skip to content

Conversation

@DS-LK
Copy link
Contributor

@DS-LK DS-LK commented Oct 11, 2021

No description provided.

/* Default/min/max stack size of each app thread */
#if !defined(BH_PLATFORM_ZEPHYR) && !defined(BH_PLATFORM_ALIOS_THINGS) \
#ifdef BH_PLATFORM_NUTTX
#define APP_THREAD_STACK_SIZE_DEFAULT PTHREAD_STACK_DEFAULT
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does these macro defined in POSIX standard?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

#define APP_THREAD_STACK_SIZE_DEFAULT PTHREAD_STACK_DEFAULT
#define APP_THREAD_STACK_SIZE_MIN PTHREAD_STACK_MIN
#else
#define APP_THREAD_STACK_SIZE_DEFAULT (32 * 1024)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace the hard coded size with PTHREAD_STACK_DEFAULT and PTHREAD_STACK_MIN on POSIX compatible system ?

Please take a look ? @wenyongh

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about change to:

#if defined(BH_PLATFORM_ZEPHYR) || defined(BH_PLATFORM_ALIOS_THINGS) \
    || defined(BH_PLATFORM_ESP_IDF) || defined(BH_PLATFORM_OPENRTOS)
#define APP_THREAD_STACK_SIZE_DEFAULT (6 * 1024)
#define APP_THREAD_STACK_SIZE_MIN (4 * 1024)
#elif defined(PTHREAD_STACK_DEFAULT) && defined(PTHREAD_STACK_MIN)
#define APP_THREAD_STACK_SIZE_DEFAULT PTHREAD_STACK_DEFAULT
#define APP_THREAD_STACK_SIZE_MIN PTHREAD_STACK_MIN
#else
#define APP_THREAD_STACK_SIZE_DEFAULT (32 * 1024)
#define APP_THREAD_STACK_SIZE_MIN (24 * 1024)
#endif

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, thank you all.

N/A

Signed-off-by: zhouliang3 <[email protected]>
Change-Id: I7ea16fdb91ea9bc9215a9dee7c983192d990b87c
@wenyongh wenyongh merged commit dc65d29 into bytecodealliance:main Oct 12, 2021
wenyongh referenced this pull request in wenyongh/wasm-micro-runtime Oct 12, 2021
Set APP_THREAD_STACK_SIZE_DEFAULT/MIN for POSIX platforms (#779)
vickiegpt pushed a commit to vickiegpt/wamr-aot-gc-checkpoint-restore that referenced this pull request May 27, 2024
…liance#779)

Set APP_THREAD_STACK_SIZE_DEFAULT/MIN to PTHREAD_STACK_DEFAULT/MIN
when the macros are defined.

Signed-off-by: zhouliang3 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants