Comments (6)
One of the tasks of the dispatcher-fiber is to release terminated worker-fibers (== fibers created by the user-code). The dispatcher-fiber is the first fiber in the ready-queue when the application/thread starts. It always enqueues itself before it hands-over to another worker-fiber (dequeued from the ready-queue).
So the dispatcher-fiber should be executed multiple times in your app.
from fiber.
Thanks for the quick reply. I can see that the dispatcher fiber is scheduled to run, however in the shared_work scheduler at least, it does not run unless there are no worker fibers pending:
if ( ! rqueue_.empty() ) { /*<
pop an item from the ready queue
>*/
ctx = rqueue_.front();
rqueue_.pop_front();
lk.unlock();
BOOST_ASSERT( nullptr != ctx);
context::active()->attach( ctx); /*<
attach context to current scheduler via the active fiber
of this thread
>*/
} else {
lk.unlock();
if ( ! lqueue_.empty() ) { /*<
nothing in the ready queue, return main or dispatcher fiber
>*/
from fiber.
right - shared_work was previously in the examples , so I missed the implementation details
from fiber.
releated to #112
from fiber.
The problem is that the dispatcher-fiber is not correctly scheduled in the shared_work algo.
If you take a look at work_stealgin algo (branch develop) you see that the dipatcher-fiber is scheduled like in round_robin.
I suggest to switch to work_stealing because it is faster (locality of data) than shared_work.
Otherwise shared_work needs some counters that manage teh scheduling of main-/dispatcher-fiber ...
from fiber.
use work-stealing scheduler instead
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.