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

525 Commits

Author SHA1 Message Date
Oliver Kowalke
1e751d7dbf Nat Goodspeed:
- Change some doc references from 'algorithm' to 'sched_algorithm'.
- Initial cut at supporting arbitrary user-coded scheduler properties.
- Set fiber_properties::sched_algo_ every time through awakened().
- Define sched_algorithm methods on fiber_base*, not worker_fiber*.
- Simplify detail::fifo by making tail_ point to last link pointer.
- Reimplement waiting_queue::push() using pointer-to-pointer trick.
- Reimplement waiting_queue::move_to() using fiber_base** scan.
- Make bounded_queue::tail_ a ptr* to simplify appending new nodes.
- Make unbounded_queue::tail_ a ptr* to simplify linking new nodes.
- Remove thread_affinity flag and access methods.
- Re-add thread_affinity specific to workstealing_round_robin.
- Remove 'priority' for every fiber, and its support methods.
2014-11-12 20:03:12 +01:00
Oliver Kowalke
6a1257442b re-factoring of thread_local_ptr<>
Conflicts:
	include/boost/fiber/detail/scheduler.hpp
	src/detail/scheduler.cpp
	src/fiber_manager.cpp
2014-10-01 23:19:36 +02:00
Oliver Kowalke
70440591cf call cleanup-function in thread_local_ptr
(cherry picked from commit fca6e0301a)
2014-09-25 19:06:01 +02: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
Oliver Kowalke
a21b18b856 update docu 2014-09-19 16:58:16 +02:00
Oliver Kowalke
5910ac9eff remove 'break' from qaiting_queue
- break prevents asio exmples from working
2014-09-18 20:37:55 +02:00
Oliver Kowalke
ae1ebd7b01 Revert "optimize the example for asio loop"
This reverts commit 61a8a8ea89.
2014-09-18 19:25:58 +02:00
Oliver Kowalke
8dc8dce605 docu update 2014-09-15 17:03:31 +02:00
olk
8b8677d061 Merge pull request #23 from absolute8511/fix-asio-example
optimize the example for asio loop
2014-09-15 16:58:18 +02:00
olk
11d9d6449b Merge pull request #22 from absolute8511/fix-deque-erase
fix deque erase, the end() iterator cannot be used as erase position.
2014-09-15 16:57:12 +02:00
Oliver Kowalke
184455bca4 remove html 2014-09-15 16:56:01 +02:00
Vincent Lee
61a8a8ea89 optimize the example for asio loop 2014-09-15 18:14:15 +08:00
Vincent Lee
c6cdd4a988 fix deque erase, the end() iterator cannot be used as erase position. 2014-09-15 18:04:36 +08:00
Oliver Kowalke
bdab3735ed update docu 2014-09-12 16:58:07 +02:00
Oliver Kowalke
c161e095af docu update 2014-09-09 21:02:12 +02:00
Oliver Kowalke
c005bb2c8f doc update 2014-09-09 20:40:26 +02:00
Oliver Kowalke
ef7eff3d43 update docu 2014-09-07 10:51:33 +02:00
Oliver Kowalke
491012776f update docu 2014-09-05 17:55:49 +02:00
Oliver Kowalke
e48252837f accept any clock type for lock_until() etc. 2014-09-05 17:55:16 +02:00
Oliver Kowalke
2d4a919faa fix errors because of -pedantic 2014-08-23 14:20:01 +02:00
Oliver Kowalke
0948d577dc fix examples 2014-08-23 14:09:21 +02:00
Oliver Kowalke
0aaff7cb6d fix queues::push(9 for MSVC 2014-08-23 13:40:42 +02:00
Oliver Kowalke
6c1229af0d call forward() and move() with namespace boost 2014-08-21 20:22:10 +02:00
Oliver Kowalke
64ea436557 inline functions for full-specialized tempaltes 2014-08-21 17:34:23 +02:00
Oliver Kowalke
4b604ff93a test for multiple definitions 2014-08-21 17:28:28 +02:00
Oliver Kowalke
e24f27c75c fix publish-subscriber example 2014-08-21 17:27:53 +02:00
Oliver Kowalke
32d4a056d0 update documentation 2014-08-20 17:37:47 +02:00
Oliver Kowalke
00944ddf6a update using chrono-clocks 2014-08-20 17:37:47 +02:00
olk
539660d132 Merge pull request #19 from niXman/develop
preprocessor inline macro replaced
2014-08-17 22:04:54 +02:00
niXman
13bbaf0ced preprocessor inline macro replaced 2014-08-17 22:56:42 +03:00
Oliver Kowalke
ef6c16e934 optimized server app in publish-subscribe example 2014-08-17 20:41:31 +02:00
Oliver Kowalke
5ede204812 optimize calling high_resolution_clock::now() 2014-08-17 20:28:40 +02:00
Oliver Kowalke
ccbda7c04a improve performance tests and docu 2014-07-31 18:04:25 +02:00
Oliver Kowalke
cffd471abb update performance tests 2014-07-30 17:59:44 +02:00
Oliver Kowalke
f615b5f6fc fix bind() using variadric args 2014-07-29 18:13:39 +02:00
Oliver Kowalke
20e6bb78ca optimize trampoline() - store fiber-fn only once 2014-07-29 18:13:05 +02:00
Oliver Kowalke
c58eb91807 consolidate performance tests 2014-07-26 10:18:27 +02:00
Oliver Kowalke
142dd2cd5b some doc corrections 2014-07-21 20:04:38 +02:00
Oliver Kowalke
19c66aa610 sech_algorithm in separat file 2014-07-21 20:04:24 +02:00
Oliver Kowalke
4a2162f83b fixes for unbounded_queue<> 2014-07-20 11:10:48 +02:00
Oliver Kowalke
e077960c14 fixes for bounded_queue<> 2014-07-20 11:10:32 +02:00
olk
e5717e7648 Merge pull request #15 from nat-goodspeed/develop
Expressions with side effects in BOOST_ASSERT() fail in release builds. :-P
2014-07-18 17:30:28 +02:00
Nat Goodspeed
59fd8ed319 Expressions with side effects in BOOST_ASSERT() fail in release builds. :-P
Also suppress a few 'unused variable' warnings.
2014-07-18 11:05:30 -04:00
olk
4af9b8c15b Merge pull request #14 from nat-goodspeed/develop
Refactor bounded_queue<T> implementation to reduce redundancy.
2014-07-18 14:46:00 +02:00
Nat Goodspeed
9e21b43221 Move new node_type allocations before locking mtx_. 2014-07-18 08:29:10 -04:00
Nat Goodspeed
d7035722b4 Pass unique_lock down to push_() and push_wait_until_().
Earlier refactoring moved the unique_lock instantiation back to public
methods, though it was referenced in private methods. Pass it into those
methods.
2014-07-17 16:53:20 -04:00
Nat Goodspeed
b01cc1f224 Reintroduce pthread_key_create() implementation for Mac thread_local_ptr.
At some point the original implementation seems to have gotten lost?
2014-07-17 15:02:04 -04:00
Nat Goodspeed
9e81e970d9 Move lock acquisition from private back to public methods.
Oliver pointed out the thread-safe-interface pattern:
http://www.cs.wustl.edu/~schmidt/PDF/locking-patterns.pdf
2014-07-17 09:40:20 -04:00
Nat Goodspeed
bcaff62763 Update docs for barrier.hpp and bounded_queue.hpp.
Use std::size_t as argument type for barrier constructor.

Add bounded_queue::upper_bound(), lower_bound(), value_pop().

Make is_empty(), is_full() const.

Add TimePointType template param to push_wait_until(), pop_wait_until().
2014-07-16 17:25:10 -04:00
Nat Goodspeed
0bde483bd2 Refactor bounded_queue<T> implementation to reduce redundancy.
Introduce private push_(), try_push_(), push_wait_until_() helper methods:
each of push(), try_push() and push_wait_until() has two signatures for
value_type const& versus value_type&&, but the code paths are identical once
we have a new node_type in hand. Moreover, extract processing common to all
into private push_and_notify_() method. (This fixes an inconsistency in push()
exception behavior.)

Extract common processing from pop(), value_pop(), try_pop() and
pop_wait_until() to private value_pop_() method. This retains a node_type::ptr
to the old head node until return time, unifying the code paths between its
return-by-value and assign-through-reference callers. (This fixes an
inconsistency in try_pop() exception behavior.)
2014-07-16 12:06:37 -04:00