Commit Graph

1840 Commits

Author SHA1 Message Date
Oliver Kowalke
dd0e1d1893 add autoreset_event for waling up dispatcher context
- dispatcher waits on autoreset_event if ready-queue is empty
- autoreset_event is set if a ready context is pushed to the
  ready-queue
2015-09-16 21:07:26 +02:00
Oliver Kowalke
a8e90aedb8 add joining a fiber 2015-09-16 20:51:26 +02:00
Oliver Kowalke
ddc5af0a36 run dispatcher context at scheduler destruction 2015-09-16 19:20:47 +02:00
Oliver Kowalke
eafeaaae01 remove examples and tests 2015-09-16 19:12:57 +02:00
Oliver Kowalke
6d43540a29 cleanup 2015-09-15 19:15:00 +02:00
Oliver Kowalke
73b3843696 test for ready-/runnabl-queue if transfered from remote_ready_queue 2015-09-13 16:35:54 +02:00
Oliver Kowalke
8c4dda107c support signaling a fiber from another thread
- for this first version lockfree::queue<> is used
- maybe Dimitry Byukov's mpsc intrusive queue is better suited
2015-09-13 09:20:35 +02:00
Oliver Kowalke
fe337fdf4c fix autoreset_event::reset() 2015-09-11 21:59:33 +02:00
Oliver Kowalke
f3b376224c comments fxed + break loop of sleeping fibers 2015-09-11 21:35:39 +02:00
Oliver Kowalke
f14be69223 remove scheduler::wait:interval_ + fixups of comments 2015-09-11 21:03:09 +02:00
Oliver Kowalke
693c53d034 fix sleep_queue: cmp-op + use set<>::insert() 2015-09-11 20:45:54 +02:00
Oliver Kowalke
070606d2d1 disable asio examples
- interaction with external event-loops not implemented
2015-09-11 20:45:54 +02:00
Oliver Kowalke
51d08226a4 if not fibers in queues - suspend till signaled or timeout
- if no fibers are ready to run suspend the thread and wait till
  * signaled by scheduler::signal() for new fiber (ready to run)
  * time_point of a sleeping fiber has reached
2015-09-11 20:45:54 +02:00
Oliver Kowalke
c416b6fe1e disable test with multi-threading
- scheduler::remote_signal() not implemented yet
2015-09-11 20:11:56 +02:00
Oliver Kowalke
abd1ff524c fixes for signaling interruption and wait 2015-09-11 18:42:16 +02:00
Oliver Kowalke
e44a41b71e add output 'done' at the end of examples 2015-09-11 18:41:46 +02:00
Oliver Kowalke
ebd147c08d fix join(), this_fiber::sleep_until() 2015-09-10 20:42:28 +02:00
Oliver Kowalke
4764c1184c signal() added 2015-09-10 19:52:08 +02:00
Oliver Kowalke
d3843efbe0 fix using intruisve::list<> 2015-09-10 18:08:10 +02:00
Oliver Kowalke
2173200c14 example simple 2015-09-10 18:07:41 +02:00
Oliver Kowalke
ce1b22b809 add sanity checks before destructing context in scheduler 2015-09-10 05:49:55 +02:00
Oliver Kowalke
c1d3d478d8 use wait_queue with safe_link featurre, use erase_and_dispose() for
unlinking
2015-09-10 05:49:10 +02:00
Oliver Kowalke
08d4537a45 Merge pull request #66 from nat-goodspeed/develop
Fix hang in priority.cpp
2015-09-10 05:35:51 +02:00
Nat Goodspeed
c9bd8360b4 Merge branch 'develop' of http://github.com/olk/boost-fiber into develop 2015-09-09 21:47:46 -04:00
Nat Goodspeed
2b6135364e Make awakened() unconditionally insert fiber.
There was a bug when the ready queue wasn't empty, but there was no
lower-priority fiber already in the queue. In that case the fiber wouldn't be
inserted. We want the loop just to advance the iterator, but to perform the
insert regardless of where the iterator ends up. (With this logic, empty() is
no longer a special case.)

Restore the ~Verbose() message.
2015-09-09 21:46:35 -04:00
Oliver Kowalke
513204a75e add termination output to example simple.cpp 2015-09-09 21:11:02 +02:00
Oliver Kowalke
fbf412aae1 delete termianted fibers 2015-09-09 21:04:56 +02:00
Nat Goodspeed
268922a9e6 Merge branch 'develop' of http://github.com/olk/boost-fiber into develop 2015-09-09 13:51:50 -04:00
Oliver Kowalke
4887028567 fix unit-test for bounded_channel 2015-09-09 19:48:55 +02:00
Oliver Kowalke
19c3df0862 ontext cleanup inf schedulerBitte geben Sie eine Commit-Beschreibung für Ihre Änderungen ein. Zeilen, 2015-09-09 19:36:30 +02:00
Oliver Kowalke
50791e3dd7 put main-context to yield-queue in ~scheduler() 2015-09-09 19:36:02 +02:00
Oliver Kowalke
9a59ee0a17 test explictly against nullptr 2015-09-09 19:35:33 +02:00
Oliver Kowalke
c89410dfd8 uses intrusive::list<> isntread hand-written queues 2015-09-09 19:22:54 +02:00
Oliver Kowalke
e4fc7e7736 restore simple example 2015-09-08 21:35:46 +02:00
Oliver Kowalke
291b9d7c17 small fixes 2015-09-08 21:33:20 +02:00
Oliver Kowalke
2cd1d39f12 fix clang compiler error regarding missing typename 2015-09-08 18:58:36 +02:00
Nat Goodspeed
40c94e7aaa Merge branch 'develop' of github.com:nat-goodspeed/boost-fiber into develop 2015-09-08 06:21:42 -04:00
Nat Goodspeed
6702d7cb9c Merge branch 'develop' of http://github.com/olk/boost-fiber into develop 2015-09-08 06:21:33 -04:00
Nat Goodspeed
9c88e5a660 Merge branch 'develop' of github.com:nat-goodspeed/boost-fiber into develop 2015-09-08 06:19:58 -04:00
Oliver Kowalke
6459b76075 do not use context::active() inside scheduler 2015-09-07 22:30:26 +02:00
Oliver Kowalke
2689e34be6 store pointer to main-context in scheduler 2015-09-07 22:29:57 +02:00
Oliver Kowalke
5854743a0a force segfault in work-sharing example 2015-09-07 22:24:20 +02:00
Oliver Kowalke
3200e419d2 increase amount of fibers and threads 2015-09-07 20:58:22 +02:00
Nat Goodspeed
f28b6fc497 Update shared_ready_queue::main_fiber comments. 2015-09-07 14:55:30 -04:00
Oliver Kowalke
18eb56d0f8 Merge pull request #65 from nat-goodspeed/develop
Update work_sharing to never share a thread's main fiber.
2015-09-07 20:55:26 +02:00
Nat Goodspeed
6cf8f4627f Update work_sharing to never share a thread's main fiber.
Instead, when the main fiber is passed to awakened(), stash it in a separate
slot and make pick_next() return it only when the shared queue is empty.

Update ready_fibers() to include a non-empty main_fiber slot.
2015-09-07 14:50:55 -04:00
Oliver Kowalke
0099b384c1 rename of flag and check function is_man_context() 2015-09-07 17:44:29 +02:00
Oliver Kowalke
d66575e2e6 fiber_manager renamed to scheduler 2015-09-07 17:35:37 +02:00
Oliver Kowalke
6499bb07e7 fiber_context renamed to context 2015-09-07 17:23:59 +02:00
Oliver Kowalke
7f97616aa2 Merge branch 'ws' into develop 2015-09-07 17:07:59 +02:00