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

Make util_ns fields: run and is_initialized atomics #10570

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dsciebu
Copy link

@dsciebu dsciebu commented Nov 21, 2024

Values of util_ns fields can be read/write in parallel from multiple threads. Making them atomics secures these kind of access.

Signed-off-by: Dariusz Sciebura [email protected]

@dsciebu dsciebu changed the title Make util_ns fileds: run and is_initialized atomics Make util_ns fields: run and is_initialized atomics Nov 21, 2024
return;

ofi_atomic_initialize32(&ns->ref, 0);
ns->listen_sock = INVALID_SOCKET;
if (!ns->hostname)
ns->hostname = OFI_NS_DEFAULT_HOSTNAME;
ns->is_initialized = 1;
ofi_atomic_set32(&ns->is_initialized, 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name service is basically a simple way to support running fabtests. It's not something we expect to have enabled as a general purpose feature.

If it were, the changes here are not sufficient to support multiple threads. Locks would be needed. It's ultimately the responsibility of the caller to have appropriate serialization to the name service calls.

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

Successfully merging this pull request may close these issues.

2 participants