Comments (10)
from fiber.
from fiber.
Mmhhh... I see.
You could provide a workaround by adding copies of the original callcc
function-templates to Boost.Context with different names (e.g. callcc_no_args
callcc_with_args
callcc_no_args_palloc
callcc_with_args_palloc
) which are only available if GCC 4.8/4.9 are used. You then have to make sure to call these specific functions from Boost.Fiber if either GCC 4.8 or 4.9 is used.
Of course this is kind of ugly but might help in this case.
I tried it out and it works. See the attached patches (against the Boost 1.64.0 release).
context__include__continuation.hpp.diff.txt
fiber__src__context.cpp.diff.txt
from fiber.
I was able to build Boost.Fiber with toolset=gcc-4.9
and run all tests successfully using the patches in PR #122 and PR boostorg/context#55. Using toolset=gcc-4.8
, a few tests failed, but most passed.
Would you be able to verify?
from fiber.
I can confirm that Boost.Fiber from Boost releases 1.64.0 with these patches compiles fine with GCC 4.8.
I assume that during compilation with b2
all tests were compiled and run automatically. And none of the tests failed! 👍
(However, I just tried to compile Boost.Fiber and no other Boost-library which depends on it or Boost.Context.)
from fiber.
I assume that during compilation with b2 all tests were compiled and run automatically.
I actually don't think the tests are run unless you explicitly run them. I'm fairly new to the Boost build toolchain, so there might be better ways to do this, but here's how I run the tests for a specific module:
./b2 toolset=gcc-4.9 cxxflags="-std=c++11" --build-dir="/tmp/nick/boost/1.64" libs/fiber/test
If it says anything about "skipped" or "failed" targets at the end of the run, then that indicates a problem.
from fiber.
OK, you are right. I somehow thought that the unit-tests would have been run automatically. (Maybe that is the case for some other Boost-libraries?)
One unit-test failed and a second was skipped because of this, when compiling with GCC 4.8. GCC 6 compiles fine instead (while Clang 3.8 does only compile the library but does not even try to compile the libraries).
So I can confirm your findings.
The failure seems to be due to the unit-test somehow trying to use the deleted copy-constructor of a move-only type (std::atomic
). Maybe just the unit-test is not entirely correct (for the standard-library of GCC 4.8) and needs to be fixed (or a workaround)?
from fiber.
The failure seems to be due to the unit-test somehow trying to use the deleted copy-constructor of a move-only type (std::atomic).
Yes, that's the same error I observed.
Maybe just the unit-test is not entirely correct (for the standard-library of GCC 4.8) and needs to be fixed (or a workaround)?
I'm guessing that this is actually an issue/deficiency in the C++ standard library that ships with GCC 4.8, which means the boost library can't really work around it (aside from maybe documenting the limitation and suggesting to upgrade your compiler toolchain). But, the good news is that everything else worked, so as long as you don't try to copy something with a deleted copy constructor into a Boost.Fiber promise, then I think you should be fine using GCC 4.8.
from fiber.
should be fixed now (not the atomic ctor issue), ty
from fiber.
I think this problem is not solved entirely (maybe related to gcc 4.9), here is my build error (branch develop):
libs/fiber/src/context.cpp: In constructor ‘boost::fibers::context::context(boost::fibers::dispatcher_context_t, const boost::context::preallocated&, const default_stack&, boost::fibers::scheduler*)’:
libs/fiber/src/context.cpp:236:14: error: call of overloaded ‘callcc(const std::allocator_arg_t&, const boost::context::preallocated&, const default_stack&, boost::fibers::context::context(boost::fibers::dispatcher_context_t, const boost::context::preallocated&, const default_stack&, boost::fibers::scheduler*)::<lambda(boost::context::continuation&&)>)’ is ambiguous
});
^
libs/fiber/src/context.cpp:236:14: note: candidates are:
In file included from ./boost/fiber/context.hpp:28:0,
from libs/fiber/src/context.cpp:7:
Updated: I fixed by checking out the boost_context to develop branch too.
from fiber.
Related Issues (20)
- Boost.fiber incompatible with C++20 HOT 1
- Boost.Fiber header compile fails with GCC Compile option -Werror=conversion
- Maybe a semaphore should be added HOT 1
- segment fault when closed buffered_channel on destructor
- build failed with cxxflags -D BOOST_FIBERS_NO_ATOMICS (version 1.80.0)
- Warning/error about unreferenced parameter in context.cpp HOT 2
- std::aligned_storage raises deprecation warning with the latest gcc 13 and C++23 (to be released in about 1 month and a half) HOT 2
- Boost fiber's demo run error when open AddressSanitizer by use Visual Studio HOT 1
- Build script relies on third party to import Context before Fiber
- Weird behavior with custom `algorithm_with_properties<>`
- Memory leak exists when setting custom scheduler algorithm in use_scheduling_algorithm function? HOT 1
- fiber::sleepfor stop updating when system clock moves backwards
- Launching fiber on a different thread HOT 3
- Could not link fiber 1.84.0 as shared library on Windows 10 HOT 4
- Mixing `fiber::mutex` and normal threads HOT 1
- Modular Boost C++ Libraries Request
- use it in qt
- Weird infinite loop when cv.notify_all() HOT 3
- no way to calculate hash of `fiber::id`
- Explicit context switch of fibers
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fiber.