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

Thread id for worker 0 is uninitialized #452

Closed
cmnrd opened this issue Jun 24, 2024 · 0 comments · Fixed by #454
Closed

Thread id for worker 0 is uninitialized #452

cmnrd opened this issue Jun 24, 2024 · 0 comments · Fixed by #454
Assignees
Labels
bug Something isn't working

Comments

@cmnrd
Copy link
Contributor

cmnrd commented Jun 24, 2024

The change implemented in #437 skips worker thread creation for worker 0. This seems to be Ok, but it also leaves env->thread_ids[0] uninitialized. Consequently, we cannot use lf_thread_set_cpu or similar API functions to set affinity or priority of the main thread from LF code. In fact, code that simply loops over all threads to set their affinity segfaults on the first worker.

A fix for this bug would assign the thread id of the main thread to env->thread_ids[0]. However, it is unclear for me how to do this in a portable way.

@cmnrd cmnrd added the bug Something isn't working label Jun 24, 2024
cmnrd added a commit that referenced this issue Jun 25, 2024
EhsanKhodadad pushed a commit to EhsanKhodadad/reactor-c that referenced this issue Aug 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants