Skip to content

Thread id for worker 0 is uninitialized #452

@cmnrd

Description

@cmnrd

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.

Metadata

Metadata

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions