Commit Graph

328 Commits

Author SHA1 Message Date
Oliver Kowalke
550c164773 macro BOOST_FIBERS_SPINLOCK_YIELD added
- if BOOST_FIBERS_SPINLOCK_YIELD is defined,
  spinlock::lock() calls std::this_thread::yield() if busy waiting
2016-10-16 10:11:23 +02:00
Oliver Kowalke
ce962f9688 (un)bounded_channel renamed to (un)bounded_queue 2016-10-13 20:17:01 +02:00
Oliver Kowalke
a251ba3878 update docu regarding to asio examples modification 2016-10-10 11:18:02 +02:00
Rene Rivera
1a6b5afa42 Add, and update, documentation build targets. 2016-10-07 23:07:33 -05:00
oliver Kowalke
187a45a1de update link in docu 2016-09-12 13:31:10 +02:00
Oliver Kowalke
e9144fba8e remove warning in docu 2016-08-20 13:16:29 +02:00
oliver Kowalke
4fbded4616 add boostdoc to doc/Jamfile 2016-06-15 08:17:09 +02:00
Oliver Kowalke
1f81bc2a5f Merge branch 'exp' into develop 2016-05-22 07:20:22 +02:00
Nat Goodspeed
155c803075 Fix documentation about random_chase_lev et al. 2016-05-20 11:39:28 -04:00
Oliver Kowalke
4e581b55d7 update documentation 2016-05-16 14:26:39 +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
f1b43062d5 update documentation 2016-05-12 20:35:21 +02:00
Oliver Kowalke
cf47ee0eb7 update docu 2016-05-08 13:51:38 +02:00
Oliver Kowalke
e3ebf6f6ef rename "launch_policy" to "launch" 2016-05-08 10:01:52 +02:00
Oliver Kowalke
cd00819982 documentation: update html files 2016-05-03 18:49:24 +02:00
Nat Goodspeed
1949291c98 Fix context::attach() documentation.
The notes erroneously imposed conditions on *this that should have been
applied instead to its parameter f.
2016-05-02 16:08:57 -04:00
Nat Goodspeed
ff35fc1f25 Flesh out doc for context::attach() and detach() + migration notes. 2016-05-02 15:56:11 -04:00
Nat Goodspeed
247e551fbd Make context::is_context(type) values explicitly unspecified. 2016-05-02 13:24:13 -04:00
Oliver Kowalke
968c32c842 replace context::migrate() by context::attach()/context::detach() 2016-05-02 18:56:17 +02:00
Oliver Kowalke
c835d09e02 update of html-files (documentation) 2016-05-01 16:42:59 +02:00
Oliver Kowalke
5c18abdbed update of html-files (documentation) 2016-05-01 09:22:06 +02:00
Nat Goodspeed
eaf592f0e5 Remove references to multiple threads, yield_hop and migration.
Also use curly apostrophes throughout.
2016-04-30 10:16:47 -04:00
Nat Goodspeed
ba171ee066 Fix the expansion of __run_service__ to abbreviated run_svc() name.
Also make __io_service__ expand to a link to Asio documentation.
2016-04-30 10:14:46 -04:00
Nat Goodspeed
b1fe17d264 Make boost::asio::io_service a link in 'support for Boost.Asio'. 2016-04-30 10:10:32 -04:00
Nat Goodspeed
fd96f095e5 Bundled [^...] template works better than my [`...] with embedded link. 2016-04-30 10:10:32 -04:00
Nat Goodspeed
0508706572 Use new [s] and [t] templates to produce curly apostrophes. 2016-04-30 10:10:32 -04:00
Nat Goodspeed
f4bc10e331 Add [,] template for curly apostrophe.
Also add [s] and [t] templates so we can write it[s] rather than it[,]s and
isn[t] rather than isn[,]t.

Remove extraneous spaces from inline template definitions: the spaces were
considered part of the template expansion! This was causing odd spacing where
those templates were used.
2016-04-30 10:10:32 -04: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
Nat Goodspeed
88f5f06fed Describe updated Fiber / Asio round_robin integration. 2016-04-29 16:26:01 -04:00
Nat Goodspeed
a0a72a1eb0 Use sections rather than headings to add table-of-contents entries. 2016-04-29 16:25:02 -04:00
Oliver Kowalke
57267ec957 remove support for fiber interruption 2016-04-19 18:16:31 +02:00
Nat Goodspeed
9b3559dd49 Remove 'yield_hop' and the whole allow_hop_ mechanism.
Given the necessity for fibers::asio::round_robin to share its ready queue
among all threads calling io_service::run() on the same io_service instance,
the capability to allow hop (or not) in the fibers::asio::yield mechanism is
redundant.
2016-04-06 12:17:35 -04:00
Oliver Kowalke
ff3da9ec0f fix typo in stack.qbk 2016-03-28 20:29:27 +02:00
Oliver Kowalke
6b490eb190 update stack.qbk 2016-03-28 20:23:08 +02:00
Oliver Kowalke
f3cb64fb91 update html 2016-03-28 18:15:14 +02:00
Nat Goodspeed
4ebc1ed2f4 Update fibers::asio::yield doc for current implementation. 2016-03-27 22:46:38 -04:00
Nat Goodspeed
85c0d26d11 Fix minor errors in doc generation. 2016-03-23 21:28:40 -04:00
Nat Goodspeed
f905cb4c3b Document context::suspend() and set_ready(). 2016-03-12 10:45:54 -05:00
Nat Goodspeed
d9e5bde625 Make a pass through enum class type and new context::is_context().
Do not document the specific values of enum class type values. Consuming code
should be based solely on enum names; their values are an implementation
detail.

Ensure that all enum class type values are mentioned in note for is_context()
method.
2016-03-07 21:17:56 -05:00
Nat Goodspeed
908bd3ca68 Fix up references to traits_type in stack allocation section.
Provide a link to Boost.Context's stack_traits documentation to look up
is_unbounded(), minimum_size() and maximum_size().

Fix spellings of minimum_size() and maximum_size().

When stack_traits::is_unbounded(), we shouldn't have to care about
stack_traits::maximum_size(). Consistently change:

    ! traits_type::is_unbounded() && size <= traits_type::maximum_size()

to:

    traits_type::is_unbounded() || size <= traits_type::maximum_size()
2016-03-07 21:14:37 -05:00
Nat Goodspeed
fb17dc13d4 Haskell has two L's -- see https://www.haskell.org/ 2016-03-07 20:51:58 -05:00
Oliver Kowalke
26ca17f4e5 docu related to skynet 2016-03-04 19:15:41 +01:00
Oliver Kowalke
cd92c2b003 update docu 2016-03-04 19:10:22 +01:00
Oliver Kowalke
3572b00e59 update docu regarding to performance 2016-02-28 15:56:54 +01:00
Oliver Kowalke
ccd6ebd974 update docu for stacks 2016-02-27 20:28:34 +01:00
Oliver Kowalke
58e745dcc3 documentation updated 2016-02-27 20:20:03 +01:00
Oliver Kowalke
6f0caee2e7 docu: make isntalltion section an appendix 2016-02-18 19:23:55 +01:00
Oliver Kowalke
fb11931689 Update scheduling.qbk 2016-02-16 08:30:50 +01:00
Oliver Kowalke
d5faf0c8fb fix docu for context::is_context() 2016-02-16 08:29:47 +01:00
Oliver Kowalke
884bd21c4d reintroduce future<>::get() specializations in future.qbk 2016-02-16 08:15:48 +01:00
Oliver Kowalke
d8124ab12f disable section 'installing' at first 2016-02-16 08:12:33 +01:00
Oliver Kowalke
8536cdd8fe migrate a running fiber (not thread) 2016-02-16 08:10:17 +01:00
Nat Goodspeed
de4b03cb21 Tweak new wording in Rationale section.
Add a link to the section "No Spurious Wakeups" in the condition_variable
section.

Make a pass over "migrating fibers between threads," adding a link to the
whole new section on that same topic.
2016-02-15 20:31:52 -05:00
Nat Goodspeed
ea0c16080b A few more documentation-related edits 2016-02-15 17:12:56 -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
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
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
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
1f33787ade update docu 2016-01-20 19:42:40 +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
d541e88a4b update documentation 2015-12-29 15:04:13 +01:00
Oliver Kowalke
f9c5075e10 update docu 2015-12-12 23:32:28 +01:00
Oliver Kowalke
ab2d0ae52e documentation updated 2015-12-04 18:26:49 +01:00
Oliver Kowalke
abe114ad81 segmented-stacks=on -> only segmented_stack is available 2015-10-18 19:21:45 +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
26ea3aa41c fix performace footnote issue 2015-09-05 15:29:42 +02:00
Oliver Kowalke
c4cfef7148 fix documentation issue related to footnote in table 2015-09-05 15:24:30 +02:00
Oliver Kowalke
2dbdd73e6e fix performance tests for std::thread 2015-09-05 15:21:43 +02:00
Oliver Kowalke
f8c97ffa16 initialize duration with zero 2015-09-05 13:49:29 +02:00
Oliver Kowalke
2e26806bb3 update performance tests and correct values in performance docu 2015-09-05 13:41:03 +02:00
Oliver Kowalke
c24c73dc11 documentation: hint for stack allocation in performance tests 2015-09-03 20:28:08 +02: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
b465af2c39 Merge branch 'develop' of github.com:olk/boost-fiber into develop 2015-09-02 16:59:44 -04:00
Nat Goodspeed
abc1aa610e Proofreading pass continues through stack allocation. 2015-09-02 16:59:06 -04:00
Oliver Kowalke
a173c047a6 update documentation 2015-09-02 19:41:08 +02: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
aeaef6510f Reverse advice about when to set the properties for a new fiber.
Change which example code we show for this_fiber::properties<>() and
fiber::properties<>().
2015-09-01 19:55:33 -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
Oliver Kowalke
847d84e50e Merge pull request #59 from nat-goodspeed/develop
Notes about fiber launch and barrier awakening.
2015-09-01 17:41:26 +02:00
Oliver Kowalke
82143be5aa update documentation + formating 2015-09-01 17:32:07 +02:00
Nat Goodspeed
518709249b Merge branch 'develop' of github.com:olk/boost-fiber into develop 2015-09-01 11:26:36 -04:00
Nat Goodspeed
90d8e059f0 Notes about fiber launch and barrier awakening. 2015-09-01 11:25:36 -04:00
Oliver Kowalke
fefffd37eb update documentation 2015-09-01 17:17:38 +02:00
Oliver Kowalke
d15ea79bfa Merge pull request #58 from nat-goodspeed/develop
Start of proofreading pass
2015-09-01 07:59:02 +02:00
Oliver Kowalke
e91bbf1274 doucmentation: fix references to files in performance.qbk 2015-09-01 06:39:50 +02:00
Nat Goodspeed
c6ccbbc112 Add footnote about yield() being insufficient to interrupt a detached fiber. 2015-08-31 20:30:57 -04:00