Boost logo

Boost Users :

Subject: Re: [Boost-users] [boost] Boost.Fiber mini-review September 4-13
From: Oliver Kowalke (oliver.kowalke_at_[hidden])
Date: 2015-09-05 15:14:49


2015-09-05 21:06 GMT+02:00 Hartmut Kaiser <hartmut.kaiser_at_[hidden]>:

> HPX itself uses TLS to store
>
> a) a reference to the current scheduler responsible for the particular
> kernel-thread, and
> b) a reference to the currently active (running) fiber object.
>
> Both uses are safe as they are maintained by the runtime.
>

what does that mean 'maintained by the runtime'?

void bar( ptr_scheduler_thread_local_var) {
  printf("%p\n", ptr_scheduler_thread_local_var);
  suspend_and_migrate_fiber();
}

void foo() {
   while ( true) {
      bar( return_ptr_of_scheduler_thread_local_var() );
      ...
   }
}

in this example b) accesses a) (TLS of scheduler) prints in to stdout
suspends active fiber and migrates it to another thread
after resumption the address of the TLS-scheduler is printed out ...

how does your code look like after compiler optimization?!



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net