2
0
mirror of https://github.com/boostorg/fiber.git synced 2026-01-19 16:22:11 +00:00

38 Commits

Author SHA1 Message Date
Oliver Kowalke
2fff971242 fix unsufficent synchronization of work-stealing algorithms 2018-08-21 09:53:37 +02:00
oliver Kowalke
514aa157ea examples: barrier sync. threads renamed to thead_barrier 2017-11-17 10:05:53 +01:00
Oliver Kowalke
328bf234d1 fix examples for Solaris 2017-06-17 15:07:14 +02:00
Oliver Kowalke
1f81bc2a5f Merge branch 'exp' into develop 2016-05-22 07:20:22 +02:00
Oliver Kowalke
310f3ce2f2 move sched_algorithm to algo::algorithm
- new namesapce algo
- shared_round_robin with shared ready queue
2016-05-13 20:14:48 +02:00
oliver Kowalke
4d47c74911 examples work sharing/stealing: spin in suspend_until()
- no fiber will sleep in both examples
- threads spin in dispatcher-fiber calling sched_algo::suspend_until()
  because thread should not be blocked if no ready fiber is available
2016-05-09 12:00:37 +02:00
Nat Goodspeed
ff35fc1f25 Flesh out doc for context::attach() and detach() + migration notes. 2016-05-02 15:56:11 -04:00
Oliver Kowalke
968c32c842 replace context::migrate() by context::attach()/context::detach() 2016-05-02 18:56:17 +02:00
Nat Goodspeed
8376fda3ba Merge branch 'develop' of github.com:olk/boost-fiber into develop 2016-02-15 19:34:04 -05:00
Oliver Kowalke
e43cf5b1ac enum for context types 2016-02-15 19:49:22 +01:00
Nat Goodspeed
87551c5419 Snapshot of ongoing pass through Fiber documentation.
Highlight predicate condition_variable::wait() method in condition_variable
front matter.

Rewrite the explanation of wait()'s Precondition.

Add a condition_variables subsection about no spurious condition_variable
wakeups. Remove "or spuriously" from wakeup conditions in wait*() methods.
First pass through "spurious wakeup" section in Rationale.

First pass through migration.qbk. Use lock_t throughout work_sharing.cpp,
instead of lock_t, lock_count and explicit std::unique_lock<std::mutex>
declarations. Unify treatment of main and dispatcher fibers.

Clarify thread-safety requirements on sched_algorithm::notify() and
suspend_until().

Clarify disable_interruption when rethrowing fiber_interrupted.

Consolidate future<T>::get(): returns T whether T is R, R& or void.

Mention nesting of disable_interruption (which matters) versus nesting of
restore_interruption (which doesn't). Mention that a disable_interruption
constructed within the scope of another disable_interruption is a no-op, both
itself and when passed to restore_interruption.

When packaged_task::operator()() stores a value or an exception, state "as if"
by promise::set_value() or set_exception(): the shared state is set ready.
Similarly for ~packaged_task() and ~promise() setting broken_promise.

Sprinkle links to the Allocator concept, std::allocator and
std::allocator_arg_t where referenced. Similarly for StackAllocator.

Add more cross-reference links where Fiber classes and methods are mentioned.
Also things like std::unique_lock and std::mutex.

Clarify error condition for value_pop() when channel is close()d.

Since fiber_specific_ptr::release() does not invoke cleanup, it should not
throw an exception raised during cleanup.
2016-02-11 11:27:26 -05:00
Nat Goodspeed
3b9e9a3a56 Snapshot of documentation update for 2016 review.
Note effect of BOOST_USE_SEGMENTED_STACKS if StackAllocator is not explicitly
passed.

Introduce function_heading_for QuickBook template to allow separate
descriptions of swap(fiber), swap(packaged_task) and swap(promise).

Document async() using C++14 std::result_of_t and std::decay_t, aligning with
std::async() documentation.

Rework when_any / when_all examples to use unbounded_channel throughout, since
we always close() the channel after the first value anyway. bounded_channel
doesn't really add much value here.

Make wait_first_outcome_impl() infer its channel pointer type. That way we can
reuse that function instead of coding a separate wait_all_until_error_impl(),
which differs only in using the nchannel facade instead of directly pushing to
unbounded_channel.

Explain use of std::bind() to bind a lambda.

Use a more nuanced discussion of promise lifetime in write_ec() example
function.

Use condition_variable::wait(lock, predicate) in a couple places in
work_sharing.cpp example.
2016-02-06 23:17:04 -05:00
Oliver Kowalke
59a4317bf3 use condition_variable::wait(lk,pred) 2016-02-02 17:07:29 +01:00
Oliver Kowalke
a4c2315c54 fix examples because autoreset_event was removed 2016-01-25 21:47:58 +01:00
Oliver Kowalke
172d5569a6 fix typo in comment of example work_sharing.cpp 2016-01-20 19:44:59 +01:00
Oliver Kowalke
f01cf1daff update migration example 2016-01-20 19:42:26 +01:00
Oliver Kowalke
34be91cb3c update docu migration 2016-01-17 21:08:29 +01:00
Oliver Kowalke
3319841788 use spinlock_lock+context instead of function<> 2015-12-03 17:57:00 +01:00
Oliver Kowalke
726d4d51b9 ++14 polishing 2015-12-01 21:07:11 +01:00
Oliver Kowalke
f743b63bc0 replace context::attach()/detach() by context::migrate() 2015-10-21 15:25:12 +02:00
Oliver Kowalke
51c1a96c4d introduce attach/detach of context 2015-10-14 13:37:44 +02:00
Oliver Kowalke
7617b74e57 remove second unlinking from worker-queue in work-sharing example 2015-10-12 22:05:15 +02:00
Oliver Kowalke
c07115115c work sharing example: some modifications 2015-10-12 18:55:54 +02:00
Oliver Kowalke
0deb75a699 modify work-sharign example 2015-10-12 18:44:21 +02:00
Oliver Kowalke
380e8b30c1 use atomic coutner for remainng fibers
- instead of using scheduling_algorithm::has_ready_fibers() use
  a atomic counter as termination indication
- scheduling_algorithm::has_ready_fibers() returns true even if
  only main-context and dispatcher-context are ready -> false indication
  for work-sharing example
2015-10-11 12:01:30 +02:00
Oliver Kowalke
d4c7232fa2 modify work-sharing example 2015-10-11 08:41:49 +02:00
Oliver Kowalke
ecab1c5ee6 work-sharing example 2015-10-10 21:51:14 +02:00
Oliver Kowalke
253d981f52 examples added 2015-09-29 17:55:46 +02:00
Oliver Kowalke
eafeaaae01 remove examples and tests 2015-09-16 19:12:57 +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
c89410dfd8 uses intrusive::list<> isntread hand-written queues 2015-09-09 19:22:54 +02:00
Nat Goodspeed
6702d7cb9c Merge branch 'develop' of http://github.com/olk/boost-fiber into develop 2015-09-08 06:21:33 -04: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
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
6499bb07e7 fiber_context renamed to context 2015-09-07 17:23:59 +02:00
Oliver Kowalke
4dc5aaab59 add example of work-sharing 2015-09-07 11:53:13 +02:00