Oliver Kowalke
03e39b0400
c++14 - autoreset_event
2015-11-30 20:22:58 +01:00
Oliver Kowalke
3c8547c161
remove file interupt_flags.hpp
2015-11-30 20:22:32 +01:00
Oliver Kowalke
7bd1863115
apply noexcept
2015-11-25 19:32:32 +01:00
Oliver Kowalke
a344247f07
remove forced_unwind and related functions
...
- unwinding the stack via exception is not always necessary
- usually a fiber returns from its fiber-fn (stack is already unwound)
- if a fiber has to terminate, interrupt that fiber
2015-11-25 19:30:25 +01:00
Oliver Kowalke
26227e31b2
refactor scheduler::dispatch()
2015-11-25 19:25:48 +01:00
Oliver Kowalke
6112d85a1a
test for max. time_point before apply to condition_variable
...
- autoreset_event::reset() might get an time-point with value
of std::chrono::steady_clock::time_point::max()
- this value make the underlying call to pthread_condition_wait() fail
(not reported by std::condition-variable::wait_until())
2015-11-25 19:21:11 +01:00
Oliver Kowalke
6d3f00902f
use this in capture-list
2015-11-22 14:42:28 +01:00
Oliver Kowalke
ca655a84d9
execute func + set active fiber inside context::resume()
2015-11-22 14:28:09 +01:00
Oliver Kowalke
a71e19ec4b
fix work-stealing example
2015-11-11 07:18:32 +01:00
Oliver Kowalke
6fe869b5eb
re-enable test for conditions in mt-env
2015-10-21 20:57:41 +02:00
Oliver Kowalke
5277c51bbb
re-add previously removed context::attach()
2015-10-21 15:40:50 +02:00
Oliver Kowalke
5973f6a262
add work-stealing example
2015-10-21 15:26:55 +02:00
Oliver Kowalke
cfc4b6f292
protect worker_queue by spinlock
2015-10-21 15:26:06 +02:00
Oliver Kowalke
f743b63bc0
replace context::attach()/detach() by context::migrate()
2015-10-21 15:25:12 +02:00
Oliver Kowalke
4e6b625f65
assert if source and traget context are euqal in resume_()
2015-10-20 17:52:01 +02:00
Oliver Kowalke
ee2fc59ca1
call destructor for stored values in shared_state
2015-10-20 10:09:57 +02:00
Oliver Kowalke
11419967cd
condition unlocks external mutex befor context switch
2015-10-18 20:07:24 +02:00
Oliver Kowalke
8ddf96f756
reformating in scheudler.hpp
2015-10-18 20:07:01 +02:00
Oliver Kowalke
bc9c20b7f0
fix test of conditions shared by threads
2015-10-18 20:06:20 +02:00
Oliver Kowalke
2e1c458366
remove unused local variable in condition.cpp
2015-10-18 20:05:35 +02:00
Oliver Kowalke
4b826c1738
protect mutex::unlock() caled by non-owning fiber
2015-10-18 20:04:11 +02:00
Oliver Kowalke
4710e12fe1
rename scheduler::re_schedule() -> scheduler::suspend()
2015-10-18 20:03:38 +02:00
Oliver Kowalke
af6ead53ae
static assert for linking context with a queue
2015-10-18 20:00:41 +02:00
Oliver Kowalke
abe114ad81
segmented-stacks=on -> only segmented_stack is available
2015-10-18 19:21:45 +02:00
Oliver Kowalke
b540e80619
cotnext::suspend() with default parameter nullptr
2015-10-18 09:23:15 +02:00
Oliver Kowalke
d49aeb194c
add performance tests
2015-10-18 09:09:05 +02:00
Oliver Kowalke
5f5a607d87
request unwinding and resume fibers at end of dispatch()
2015-10-18 09:08:15 +02:00
Oliver Kowalke
e63186adfe
use std::addressof() for references in shared_state<R&>
2015-10-17 15:17:31 +02:00
Oliver Kowalke
559e498982
context::terminate() as replacement for set_terminated_()/release()
2015-10-17 15:10:28 +02:00
Oliver Kowalke
edd439233a
fixups for asio examples
2015-10-17 14:41:53 +02:00
Oliver Kowalke
b102d8a89d
fix test (multithreading)
2015-10-16 22:16:24 +02:00
Oliver Kowalke
bafd65bcf3
remove yield-queue + pass functor to resume-op
2015-10-16 21:48:57 +02:00
Oliver Kowalke
6dfd42c343
reduce loop count for testing conditions mt
2015-10-16 21:47:39 +02:00
Oliver Kowalke
338f9754ee
move yielded context' after resume-op
2015-10-15 12:21:54 +02:00
Oliver Kowalke
de076200a6
future: support moveable-only types
2015-10-14 21:03:33 +02:00
Oliver Kowalke
79e5776805
qualify functions which use intrusive-list with const and noexcept
2015-10-14 16:05:20 +02:00
Oliver Kowalke
65f33ae615
remove unnecessary checks
2015-10-14 15:54:08 +02:00
Oliver Kowalke
5345d810a8
asio: executed dummy fiber after sleep-timer expires
2015-10-14 13:43:14 +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
7d18820962
erase terminated context from worker-queue
2015-10-12 22:03:20 +02:00
Oliver Kowalke
c738fefec7
remove spinlock protecting context lists
2015-10-12 21:59:47 +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
1eafd3e281
support movable types
2015-10-12 10:29:14 +02:00
Oliver Kowalke
22b96fc826
assertion: main- and dispatcher cotnext must not be unwinded
2015-10-11 12:04:20 +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
ac167e4d36
newline in test/Jamfile added
2015-10-11 12:01:03 +02:00
Oliver Kowalke
b859f8984a
add assertion in get_next_() ensures scheduler is set
2015-10-11 08:44:06 +02:00
Oliver Kowalke
950a1571bb
do not move yielded contexts in resume_()
2015-10-11 08:43:40 +02:00