Add oals::rt platform shim - #2
Conversation
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
left a comment
There was a problem hiding this comment.
I have not much to say. The implementation is clean.
| } | ||
| } | ||
|
|
||
| void precise_sleep(long ns) { |
There was a problem hiding this comment.
The unit of sleep time should be seen explicitly. Maybe, change its name to something like precise_sleep_ns(...)
There was a problem hiding this comment.
Makes sense!
| #include <cstdint> | ||
|
|
||
|
|
||
| namespace oals::rt { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
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.