Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question on use of thread_count #38

Open
Defragster opened this issue Aug 9, 2022 · 0 comments
Open

Question on use of thread_count #38

Defragster opened this issue Aug 9, 2022 · 0 comments

Comments

@Defragster
Copy link
Contributor

Looking at output from
char *Threads::threadsInfo(void) { static char _buffer[Threads::UTIL_TRHEADS_BUFFER_LENGTH]; uint _buffer_cursor = 0; _buffer_cursor = sprintf(_buffer, "_____\n"); for (int each_thread = 0; each_thread <= thread_count; each_thread++)
That starts on [0] to [3] with 4 added threads without the added "<=" then it runs and shows the 5 actual threads.

thread_count seems to start at 0 even though there is always 1 main thread? It is only incremented with add_thread.

Wondering about other references to thread_count in TeensyThreads.cpp that start at 0 like this:
//get lowest sleep interval from sleeping tasks into task_id_ends for (i = 0; i < thread_count; i++) {

Also - maybe threadsinfo() was meant to SKIP [0] - the stack info printed is showing bad numbers - at least on a T_3.5:
0:Stack size:10240|Used:537067512|Remains:-537057272|State:RUNNING|

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

No branches or pull requests

1 participant