2
0
mirror of https://github.com/boostorg/fiber.git synced 2026-02-19 02:12:24 +00:00
Commit Graph

1207 Commits

Author SHA1 Message Date
Nat Goodspeed
8376fda3ba Merge branch 'develop' of github.com:olk/boost-fiber into develop 2016-02-15 19:34:04 -05:00
Nat Goodspeed
ea0c16080b A few more documentation-related edits 2016-02-15 17:12:56 -05:00
Oliver Kowalke
e43cf5b1ac enum for context types 2016-02-15 19:49:22 +01:00
Oliver Kowalke
3522245899 link unit-tests against boost.thread 2016-02-13 11:25:02 +01:00
Nat Goodspeed
eb0d01bd28 Merge branch 'develop' of github.com:olk/boost-fiber into develop 2016-02-12 10:23:57 -05: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
963ab8a14a Clarify timed_mutex::try_lock*() error conditions. 2016-02-10 00:36:53 -05:00
Nat Goodspeed
3910baa6c8 Fix minor typo: 'an' execution context. 2016-02-10 00:28:47 -05:00
Nat Goodspeed
60e9a688ac Flesh out explanations of sched_algorithm::suspend_until(), notify().
Document boost::fibers::scheduler::ready_queue_t and expand on the
context::ready_link(), ready_unlink() and ready_is_linked() methods.

Explain migrate() restrictions on is_main_context() and
is_dispatcher_context() context instances.
2016-02-10 00:15: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
8f62e85583 Mention (with link) fiber migration in Overview section. 2016-02-09 20:22:32 -05:00
Nat Goodspeed
877baa7c8b Use ["text] template to replace "quotes" with curly double quotes. 2016-02-09 20:19:51 -05:00
Nat Goodspeed
4146812990 Add 'Installing and Running Tests' section.
Add ["text] macro for enclosing "text" in curly double quotes.
2016-02-09 20:14:45 -05:00
Oliver Kowalke
547e19a811 adapt to template execution_context (v2) 2016-02-09 17:15:36 +01:00
Nat Goodspeed
f42fdca00f Use same .qbk source for condition_variable and condition_variable_any.
Wrap the full descriptive text for both classes in a QuickBook template
parameterized with class name and appropriate substitutions for the (few)
differences between the two classes.
2016-02-08 19:44:54 -05:00
Nat Goodspeed
00cad4c187 Fix argument syntax for a member_link template invocation. 2016-02-08 16:00:04 -05:00
Nat Goodspeed
32f11ec4c6 Eliminate ref to stack-allocator concept within heading that defines it.
This produced QuickBook warnings. Clean up those warnings.
2016-02-08 15:58:42 -05:00
Nat Goodspeed
f6fc028b7f Merge branch 'develop' of github.com:olk/boost-fiber into develop 2016-02-08 09:16:49 -05:00
Oliver Kowalke
91ece536bd provide impl for move-ops in test_async 2016-02-07 12:01:47 +01: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
778656934f captured_context renamed to execution_context (v2)
- execution_context (v2) is enabled per default
- execution_context (v1) is used for segmented stacks
2016-02-06 13:34:10 +01:00
Oliver Kowalke
12555f9561 execution_context required for segmented stacks 2016-02-06 10:21:54 +01:00
Oliver Kowalke
7e183329ee use captured_context aonly 2016-02-05 18:14:38 +01:00
Oliver Kowalke
aa0bdfffa6 fix unit-tests 2016-02-03 17:08:19 +01:00
Oliver Kowalke
da14401975 enhance tests 2016-02-03 16:56:28 +01:00
Oliver Kowalke
ea1003b48a cast function + arguments to rvalues before apply() 2016-02-03 16:55:44 +01:00
Oliver Kowalke
59a4317bf3 use condition_variable::wait(lk,pred) 2016-02-02 17:07:29 +01:00
Oliver Kowalke
6567fde460 add initializer brackets to yeld in example 2016-02-02 17:07:01 +01:00
Oliver Kowalke
bacbb59afa pass active cotnext directly to yield() 2016-02-02 17:06:21 +01:00
Oliver Kowalke
8b3d3a195f reduce access to context::active() 2016-02-02 17:05:54 +01:00
Oliver Kowalke
1ace8bbb36 make async_result::get() an interruption point 2016-01-31 18:14:24 +01:00
Oliver Kowalke
3ac9dde4d0 update asio integration example 2016-01-31 16:48:04 +01:00
Oliver Kowalke
284bdf6f78 fix asio integration - skip promise_handler 2016-01-31 16:14:14 +01:00
Oliver Kowalke
62b2a52857 some fixes for asio integration - promise problematic 2016-01-31 11:00:08 +01:00
Oliver Kowalke
51f4cb1a26 update asio integration in directory examples 2016-01-29 17:04:15 +01:00
Oliver Kowalke
3cfe41c01e fix asio/round_robin.hpp
block thread only in io_service::rune_one() if no fibers ready
2016-01-26 11:54:27 +01:00
Oliver Kowalke
dd661d4e5d attempt of better integration with asio 2016-01-25 21:48:18 +01:00
Oliver Kowalke
a4c2315c54 fix examples because autoreset_event was removed 2016-01-25 21:47:58 +01:00
Oliver Kowalke
81ac20b3dc remove autoreset_event 2016-01-24 16:12:44 +01:00
Oliver Kowalke
a36d229000 update docu 2016-01-20 19:45:14 +01:00
Oliver Kowalke
172d5569a6 fix typo in comment of example work_sharing.cpp 2016-01-20 19:44:59 +01:00
Oliver Kowalke
1f33787ade update docu 2016-01-20 19:42:40 +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
aaf9dde6eb docu 2016-01-14 20:20:09 +01:00
Oliver Kowalke
baa2a109a1 overhead of clock not in performance output 2016-01-14 18:58:20 +01:00
Oliver Kowalke
d541e88a4b update documentation 2015-12-29 15:04:13 +01:00
Oliver Kowalke
c3e54f5dcf remove noexcept from fiber_specific_ptr ctor 2015-12-29 14:48:36 +01:00
Oliver Kowalke
6f5d2b5376 nvalid_argument and fiber_resource_error rremoved 2015-12-29 14:17:03 +01:00