Commit Graph

88 Commits

Author SHA1 Message Date
Oliver Kowalke
c8a5f4a242 docu: StackAllocator as rvalue reference in fibers ctor 2017-12-25 07:24:24 +01:00
oliver Kowalke
bda06127b5 docu: qualtify this_fiber with 'boost::` 2017-11-14 07:56:53 +01:00
Oliver Kowalke
fc7f6e297e Fixed typo in fiber.qbk
- fix provided by Florian Behrens
2017-03-12 11:14:36 +01:00
Nat Goodspeed
155c803075 Fix documentation about random_chase_lev et al. 2016-05-20 11:39:28 -04: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
e3ebf6f6ef rename "launch_policy" to "launch" 2016-05-08 10:01:52 +02:00
Nat Goodspeed
8f59f54dff Add documentation for launch_policy.
Add fiber() and async() overloads accepting launch_policy.

Now that we have launch_policy documentation, cross-link it where it's
mentioned in integration.qbk.
2016-04-29 17:58:49 -04:00
Oliver Kowalke
57267ec957 remove support for fiber interruption 2016-04-19 18:16:31 +02: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
900a367f92 Clarify that fiber_interrupted on thread's main fiber could terminate. 2016-02-09 21:01:21 -05:00
Nat Goodspeed
fa9cf0d0d2 Clarify disposition/propagation of fiber_interrupted exception.
There's a blanket statement under 'Exceptions' that any exception not caught
by a running fiber will cause the program to terminate. fiber_interrupted is
an exception to this rule: that exception will terminate the fiber, but not
the whole program.

Explain that when a fiber running packaged_task is terminated by
fiber_interrupted, and another fiber calls future::get() on the future from
that packaged_task, fiber_interrupted will be rethrown regardless of
disable_interruption. This is implicit in existing material, but worth making
explicit.

Explicitly state that a thread's main fiber may call (e.g.) this_fiber::yield().

[un]bounded_channel::try_{push,pop}() are not interruption_points. Remove them
from the big list.

Semantics of operator<(fiber, fiber) depend solely on operator<(fiber::id,
fiber::id). Restating semantics of the latter function not needed.

Add a note clarifying the phrase "timeout-related exceptions."
2016-02-09 20:26:04 -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
d541e88a4b update documentation 2015-12-29 15:04:13 +01:00
Oliver Kowalke
ab2d0ae52e documentation updated 2015-12-04 18:26:49 +01:00
Nat Goodspeed
d653cbdcc6 Finish proofreading pass.
Add a note to the condition_variable::wait_for(..., pred) overload.

fiber_specific_ptr::reset() has no default argument.

Remove mention of launch policy deferred, since no API accepts a launch
policy argument.

Copy construction or copy assignment of a shared_future leaves other.valid()
unchanged. It won't be 'true' unless it was 'true' before.

Mention that [shared_]future::get_exception_ptr() does not invalidate.

Note that 'blocks' and 'suspends' are used interchangeably.

Add some cross-references; add link to std::allocator_arg_t. Clarify the
cross-reference to the paragraph describing BOOST_FIBERS_NO_ATOMICS.

Reformat some overly-long source lines.
2015-09-03 09:16:09 -04:00
Nat Goodspeed
abc1aa610e Proofreading pass continues through stack allocation. 2015-09-02 16:59:06 -04:00
Nat Goodspeed
2119ead28d Add note about this_fiber::properties<>() possibly yielding. 2015-09-02 12:07:57 -04:00
Nat Goodspeed
227b621e43 Continuing proofreading pass 2015-09-01 21:07:53 -04:00
Nat Goodspeed
1007d7db6d Remove fiber::properties<>() requirement to have been scheduled once.
Since instantiating a fiber object immediately passes it to the scheduler,
it should be impossible to violate that precondition.
2015-09-01 19:54:55 -04:00
Nat Goodspeed
90d8e059f0 Notes about fiber launch and barrier awakening. 2015-09-01 11:25:36 -04:00
Nat Goodspeed
c6ccbbc112 Add footnote about yield() being insufficient to interrupt a detached fiber. 2015-08-31 20:30:57 -04:00
Nat Goodspeed
f3d80ef589 Update some remarks about Asio; add cross-references. 2015-08-31 20:11:05 -04:00
Nat Goodspeed
b81a65c566 Add note about interrupting detached fiber at main-fiber shutdown. 2015-08-31 12:34:38 -04:00
Nat Goodspeed
58fa3add01 Change set_scheduling_algorithm() to use_scheduling_algorithm<>(). 2015-08-31 12:21:53 -04:00
Nat Goodspeed
93a73835b8 Add [mdash] template and use it to replace --.
Also place an anchor concerning uncaught exceptions.
2015-08-30 18:36:10 -04:00
Oliver Kowalke
91555307e5 fix typo in documentation 2015-08-24 19:52:26 +02:00
Oliver Kowalke
de8feb7ff9 documentation: add link to boost.context for WinFiber support 2015-08-24 17:40:27 +02:00
Nat Goodspeed
fd9f16776a Flesh out Customization section with step-by-step directions.
Mark up examples/priority.cpp with code snippets for use in Customization.

Also clarify the effect of changing wait_interval().
2015-08-16 16:38:21 -04:00
Oliver Kowalke
dc8af4ea7a documentation: remove refrence to boost.chrono ad boost.move 2015-08-06 17:21:29 +02:00
Nat Goodspeed
23434ca2e2 Tweaks to new documentation 2015-07-29 09:21:49 -04:00
Oliver Kowalke
4140e10330 this_fiber::yield() is not an interruption point 2015-07-29 11:47:17 +02:00
Oliver Kowalke
88d44ffee6 documentation: fix fals function-links in interruption points 2015-07-29 11:19:18 +02:00
Oliver Kowalke
2cbe22d8af documentation: add free function wait_interval()
- wait_itneval() sets/returns the time interval the thread is set to
sleep if not fiber is ready to run
2015-07-29 11:18:09 +02:00
Oliver Kowalke
3dbca594df documentation: add missing interruption points in list 2015-07-29 10:59:07 +02:00
Oliver Kowalke
caf55428a1 documentation: fiber::join() asserts on not-a-fiber 2015-07-29 10:12:31 +02:00
Nat Goodspeed
e1c9b2b54c Make Rationale section reference new BOOST_FIBERS_NO_ATOMICS passage.
Tweaks to new wording.
2015-07-28 22:31:35 -04:00
Oliver Kowalke
3fac431abc documentation: this_fiber::yield() is a interruption point
- this_fiber::yield() calls fiber_manager::yield() that calls
fiber_manager::run() -> interruption point
2015-07-28 09:51:58 +02:00
Nat Goodspeed
3674114094 Merge branch 'develop' of github.com:olk/boost-fiber into develop 2015-07-19 23:11:02 -04:00
Nat Goodspeed
1dadc51ec4 Add reference documentation for custom scheduling classes.
Also resolve certain previously-dangling internal documentation
cross-references: custom, synchronization, scheduling, stack.

Add documentation placeholders for mutex (and friends) lock(), try_lock(),
unlock() methods.

Add documentation placeholders for future (and shared_future)
get_exception_ptr() methods.

Remove documentation for obsolete future (and shared_future) swap(), operator
safe_bool() and operator!() methods.
2015-07-19 22:57:56 -04:00
Nat Goodspeed
bbdd101393 Snapshot of incomplete documentation review. 2015-07-10 09:47:11 -04:00
Oliver Kowalke
e7b1ee131c add function ready_fibers() 2015-07-03 18:03:14 +02:00
Oliver Kowalke
5d18cd5a4e add interruption point after fiber_manager::run()
- functions fiber_manager::join()/fiber_manager::yield()/fiber_manager:.wait()/fiber_manager_wait_until()
  check for interrption of the current fiber
2015-06-21 10:53:37 +02:00
Nat Goodspeed
050d974e5e Merge branch 'develop' of github.com:olk/boost-fiber into develop 2015-06-14 21:14:42 -04:00
Nat Goodspeed
2946b35b0d Fix minor Quickbook syntax error. 2015-06-14 21:14:02 -04:00
Oliver Kowalke
5f2c8e47d4 update documentation: using Windows Fiber API 2015-06-06 09:02:01 +02:00
Oliver Kowalke
ca7e8be37c update docu 2015-05-23 18:27:08 +02:00
Oliver Kowalke
266ae8dc4b update docu 2015-02-19 19:07:46 +01:00
Oliver Kowalke
3b9382f8df update docu 2015-02-14 11:11:11 +01:00
Oliver Kowalke
2f19be6d67 use C++11 2014-12-27 19:07:42 +01:00
Oliver Kowalke
244c539a2e Add some explanatory material in scheduling.qbk about coding your own
scheduler and setting it with set_scheduling_algorithm(). Document
sched_algorithm interface class.

Fix the example in condition_variables.qbk to explicitly unlock 'lk'
before
calling process_data().
2014-09-22 19:11:22 +02:00