Reusing main thread's stack after terminating

Hello DevZone!

All samples with Application Event Manager (CAF, nRF Desktop) has simple main function like that: 

int main(void)
{
	if (app_event_manager_init()) {
		LOG_ERR("Application Event Manager not initialized");
	} else {
		module_set_state(MODULE_STATE_READY);
	}
	return 0;
}

Main thread has terminated after executing and main stack memory becomes unused throughout the application lifecycle. Is it right?

Can I reuse that memory for another thread or another purpose? What's the best practicies for using main thread with Application Event Manager?

I develop application with large count of modules and events and memory optimization is critical part for me.

Version: nRF Connect SDK 3.0.2

Best regards, Konstantin

Related