Skip to content

Add oals::rt platform shim - #2

Merged
Moi78 merged 1 commit into
masterfrom
feature/oals-rt-shim
Jun 13, 2026
Merged

Add oals::rt platform shim#2
Moi78 merged 1 commit into
masterfrom
feature/oals-rt-shim

Conversation

@jonathan-reichardt

Copy link
Copy Markdown
Contributor

Extract RT primitives (SCHED_FIFO, SCHED_RR, CPU affinity, clock_nanosleep) into oals::rt namespace in netutils/platform/rt.h+cpp Linux behavior unchanged.
macOS no-op stubs (since there is no real RT support on mac in the same way as on Linux)

macOS CI runner failing is expected, since LowLatSocket still uses Linux only syscalls and this PR doesnt touch it.

Extract RT primitives (SCHED_FIFO, SCHED_RR, CPU affinity,
clock_nanosleep) into oals::rt namespace in netutils/platform/rt.h+cpp
Linux behavior unchanged.
macOS no-op stubs (since there is no real RT support on mac in the same way as on Linux)

@Moi78 Moi78 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have not much to say. The implementation is clean.

Comment thread netutils/rt.cpp
}
}

void precise_sleep(long ns) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The unit of sleep time should be seen explicitly. Maybe, change its name to something like precise_sleep_ns(...)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Makes sense!

Comment thread netutils/rt.h
#include <cstdint>


namespace oals::rt {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

More a "me" thing than a general rule. I like to limit namespace depth for the sake of concision.
Here it is not a problem, but I let you imagine that things like oals::clocking::sync::ClockSync can start to look heavy (and also that would lead to heavy use of using namespace xxx which I think doesn't help that much in terms of clarity).

I probably would've called the namespace rt or rt_shim, as the oals is not used anywhere else.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah ok, i see! Makes sense!
The java dev in me would like to see oals::clocking::sync::ClockSync though.
Just kidding.

I was thinking olas::... because its not a network or other specific functionality, but more a helper across the whole system.

But I'm also ok renaming it to just rt.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I was thinking olas::... because its not a network or other specific functionality, but more a helper across the whole system.

Fair point. Haven't seen it that way. I think you're right. Let's keep oals::rt

@Moi78
Moi78 merged commit 1273646 into master Jun 13, 2026
1 of 4 checks passed
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