Crosscompiling context and fiber without multithreading
Dear all, I am developing for a PowerPC target under real-time os und studying a possibility to employ fibers. They seem to be a good fit, since we have a single thread but several entities, which could in fact be considered parallel. Data exchange through channels also is relevant for the project. The problem is, that though we are provided with a quite recent compiler gcc 4.7.4 with c++11 support, the multithreading part of std is missing, since the OS has its own implementation of multithreading functionality different from pthreads and std::thread. Is there any chance to compile context and fiber without multithreading support? Or it is used under the hood and can not be avoided? Best, Vitaly
- boost.fiber: you have to implement your own scheduling algorithm because the provided implementations use std::mutex - boost.context (required by boost.fiber): uses std::call_once() -> needs to be patched
Oliver, thank you for a quick reply!
- Implementing own scheduling seems to be not a difficult task, since
there is an example in documentation
- Would calling a callable directly without using std::call_once be
sufficient, since we will not use threads? Or something more involved
would be required?
I am also not much familiar with boost configuration process, could
you please recommend which toolchain to start with? I was trying to
use toolset=gcc-power and setting threading=single, which worked for
compiling serialization library. But it seems to ignore "single" for
context and uses -pthreads flag for the gcc, which is not supported by
our version of the compiler. I was able to get rid of -pthreads flag
by editing gcc.jam directly, but the build still tries to use
pthreads. May be there is a separate repository for context and fiber,
which does not use boost configuration (though I could not find any on
github)? Any help would be much appreciated!
Vitaly
On Mon, Jan 9, 2017 at 4:22 PM, Oliver Kowalke
- boost.fiber: you have to implement your own scheduling algorithm because the provided implementations use std::mutex - boost.context (required by boost.fiber): uses std::call_once() -> needs to be patched
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
2017-01-09 17:38 GMT+01:00 Vitaly Osipov
- Would calling a callable directly without using std::call_once be sufficient, since we will not use threads?
should be OK
I am also not much familiar with boost configuration process, could you please recommend which toolchain to start with? I was trying to use toolset=gcc-power and setting threading=single, which worked for compiling serialization library. But it seems to ignore "single" for context and uses -pthreads flag for the gcc, which is not supported by our version of the compiler. I was able to get rid of -pthreads flag by editing gcc.jam directly, but the build still tries to use pthreads. May be there is a separate repository for context and fiber, which does not use boost configuration (though I could not find any on github)? Any help would be much appreciated!
maybe changing "<threading>multi" to "<threading>single" in the Jamfiles might help
participants (2)
-
Oliver Kowalke
-
Vitaly Osipov