<Yorlik>
When I checked the doc links you sent yesterday, I realized some of the links inside these docs were defunct.
<Yorlik>
In the fibonacci example
hkaiser has joined #ste||ar
<heller>
Yorlik: yeah, no idea why
<Yorlik>
Unrelated question: I am trying to abstract away the differences in my Disruptor between running under HPX or vanilla. This means for example, that in spinning loops I use either this_thread::sleep:for or hpx::this_thread::yield. What would be the best way to abstract this? CRTP Mixins? To me it resembles from what I heared about executors or execution contexts. Ideas?
<Yorlik>
How fast in an order of magnitude are hpx context switches ?
<Yorlik>
Especially a hpx::this_thread::yield( ) roundtrip?
<hkaiser>
Yorlik: sub-microseconds
<Yorlik>
Allright. Thanks.
<hkaiser>
Yorlik: for the abstraction: use executors and write your own for std::threads
<Yorlik>
I am currently thinking about these things. I call the execution contexts, but maybe that's not good terminology.
<Yorlik>
I am plaing with things like this:
<Yorlik>
struct hpx_execution_context : public iExecutionContext {
<Yorlik>
/// @todo: make hard coded threshold of 200 us configurable
<Yorlik>
/// A task being swapped in would probably run at least ~200 us
<Yorlik>
/// so - any wait being smaller is not really worth to yield.
<Yorlik>
/// Using a yield() roundtrip time might be
<Yorlik>
/// also OK (and a shorter interval)
<Yorlik>
if ( wait_us < 200 ) {
<Yorlik>
hpx::this_thread::sleep_for(
<Yorlik>
std::chrono::microseconds( wait_us ) );
<Yorlik>
}
<Yorlik>
else {
<Yorlik>
hpx::this_thread::yield( );
<Yorlik>
}
<Yorlik>
}
<Yorlik>
---
<hkaiser>
shrug, sure
<Yorlik>
i am thinking about making these contexts CRTPed mix-ins, so i can keep it independent from HPX or any other threaded runtime environment. I coul e.g. extend it to coroutines or fibers later
<Yorlik>
Why shrug?
jaafar has quit [Quit: Konversation terminated!]
jaafar has joined #ste||ar
nikunj has joined #ste||ar
nikunj has quit [Ping timeout: 245 seconds]
nikunj has joined #ste||ar
jaafar has quit [Quit: Konversation terminated!]
jaafar has joined #ste||ar
nikunj has quit [Quit: Bye]
<heller>
Yorlik: Look at my execution_context branch, it has exactly this