You've already forked MicroPythonOS
mirror of
https://github.com/m5stack/MicroPythonOS.git
synced 2026-05-20 11:51:27 -07:00
Reduce stack size for more threads
This commit is contained in:
+3
-1
@@ -475,7 +475,9 @@ print("Child coroutine: Exiting")
|
||||
gc.collect()
|
||||
print("Free memory before loop:", gc.mem_free())
|
||||
try:
|
||||
_thread.stack_size(131072) # 168KB maximum at startup but 136KB after loading display, drivers, LVGL gui etc so let's go for 128KB for now, still a lot...
|
||||
# 168KB maximum at startup but 136KB after loading display, drivers, LVGL gui etc so let's go for 128KB for now, still a lot...
|
||||
# But then no additional threads can be created. So 32KB seems like a good balance, allowing for 4 threads in apps...
|
||||
_thread.stack_size(32768)
|
||||
_thread.start_new_thread(execute_script, (script_buffer, False, subwindow))
|
||||
print("Event loop started in background thread")
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user