Commit Graph

1840 Commits

Author SHA1 Message Date
Oliver Kowalke
6944cbaa45 fix header stdexcept 2017-06-25 22:37:38 +02:00
Oliver Kowalke
cf713ee5dc Merge branch 'develop' 2017-06-18 09:51:39 +02:00
Oliver Kowalke
b1483cce9e random generator is not thread-safe
- make std::minstd_rand local (static thread-local)
2017-06-18 09:49:57 +02:00
Oliver Kowalke
a490f15523 fix examples for FreeBSD 2017-06-17 17:24:53 +02:00
Oliver Kowalke
328bf234d1 fix examples for Solaris 2017-06-17 15:07:14 +02:00
Oliver Kowalke
eef3fd1695 Merge branch 'develop' 2017-06-17 12:37:19 +02:00
Oliver Kowalke
75f47d23fc reduce code in example simple 2017-06-17 12:02:01 +02:00
Oliver Kowalke
f2f181a4a8 fix this_fiber::properties() 2017-06-17 11:59:55 +02:00
Oliver Kowalke
ae82032107 NUMA topology on Linux: fix double assignmend to NUMA node0 2017-06-17 11:47:23 +02:00
Oliver Kowalke
23b82d5610 fix race related to timed-wait operations
- applies to:
    * condition_varxpaible
    * buffered_channel
    * unbuffered_channel
    * timed_mutex
    * recursive_timed_mutex
    * this_fiber::sleep_for()
    * this_fiber::sleep_until()
- if a context does a timed-wait on an primitive a race
  between timeout- and notification-event might happen
- the timeout-event is triggered by the dispatcher-context
  of the scheduler the waiting context belongs to (worker-context)
- the notification-event might be triggered by another thread
- if the nofification happens before timeout, the dispatcher-context
  needs to know this in order not the re-schedule the context (might
  already be in the ready-queue or already terminated or moved to
  another scheduler/thread)
- if the timeout happens before the notification, the notification
  routine must not re-schedule the context
- some primitives provide timed and non-timed wait-operations,
  this must be detected by dispatcher-context and notification routine

-> each timed-wait op. increments the use-counter of the context in
   order to prevent dereferencing an already termianted and thus
   deallocated context
-> each context maintains an timed-wait-status member variable
   'twstatus'
-> 'twstatus' is atomic; allowed values:
    * twstatus == 0: non-timed wait op.
    * twstatus == <address>: timed wait op., value eq. the address of
      the primitive were the timed-wait op. is applied
    * twstatus == -1: timed-wait op., context has been already resumed
      by other notification-event or timeout-event
2017-06-17 11:13:07 +02:00
Oliver Kowalke
31292e1de7 sync(): args as rvalues 2017-06-14 17:08:58 +02:00
Oliver Kowalke
4bb776e515 add work-stealing example 2017-06-13 17:52:00 +02:00
Oliver Kowalke
26e929643a documentation: algorithms do not support dynamic threads 2017-06-13 17:51:32 +02:00
Oliver Kowalke
b7ac4c67af UML statechart 2017-06-12 21:50:01 +02:00
Oliver Kowalke
048e0eb09d add try_log() to various spinlock implementations 2017-06-12 19:11:53 +02:00
Oliver Kowalke
cfa50268cf NUMA topology on Linux: fix if numa-node is not in /sys/devices 2017-06-11 14:11:18 +02:00
Oliver Kowalke
0b88b6c16a Merge branch 'develop' 2017-06-10 17:55:32 +02:00
Oliver Kowalke
0986f9d1e6 fix compiler warnings in unit-tests 2017-06-10 15:01:23 +02:00
Oliver Kowalke
732e91b634 Revert "no data transferred via continuation::resume()"
This reverts commit 953bcb423e.
2017-06-10 16:33:01 +02:00
Oliver Kowalke
73bf0b5d5c Revert "function and args not moved into context::run_()"
lets skynet_stealing_async fail (access to null pointer of context)
This reverts commit 7400595d85.
2017-06-10 16:33:01 +02:00
Oliver Kowalke
e03405f2be force inlining futex functions 2017-06-10 16:33:01 +02:00
Oliver Kowalke
18bba329e8 make std::minstd_rand non local in spinlocks 2017-06-10 16:33:01 +02:00
Oliver Kowalke
47d80ff617 refactor creation of context 2017-06-10 16:33:01 +02:00
Oliver Kowalke
cd6950c0dd reset stack-size to 4kB/8kB for skynet-tests 2017-06-10 16:33:01 +02:00
Oliver Kowalke
78f5603943 Merge branch 'develop' 2017-06-09 06:04:09 +02:00
Oliver Kowalke
027d7f3519 if dequeued from remote-ready-queue test for ready
- if a context was signaled from remote, test if
  it is already in the ready-queue (might be possible
  by a timedout wait for instance)
2017-06-08 23:22:09 +02:00
Oliver Kowalke
7400595d85 function and args not moved into context::run_() 2017-06-08 23:22:09 +02:00
Oliver Kowalke
9b2f84a77a fix overloads of fiber ctor for gcc 2017-06-08 23:22:09 +02:00
Oliver Kowalke
c8f6ddc497 use conditional expression likely/unlikely 2017-06-08 23:22:09 +02:00
Oliver Kowalke
a5b22fb6d6 prefetching of context in algo-implementations 2017-06-08 23:22:08 +02:00
Oliver Kowalke
18c0a64dfd correct CPU model used for perforance tests in documentation 2017-06-08 23:22:08 +02:00
Oliver Kowalke
1ddea95ccc fiber unit-tests pass pointer instead of reference (MSVC-14.0 issue) 2017-06-08 23:22:08 +02:00
Oliver Kowalke
90403fd89f adjust timeouts in unit-test 2017-06-08 23:22:08 +02:00
Oliver Kowalke
d55ba1d97f reset stack-size to 4kB for skynet-tests 2017-06-08 20:40:32 +02:00
Oliver Kowalke
3e7e9e6a67 if dequeued from remote-ready-queue test for ready
- if a context was signaled from remote, test if
  it is already in the ready-queue (might be possible
  by a timedout wait for instance)
2017-06-08 20:01:44 +02:00
Oliver Kowalke
3531f2c0a6 function and args not moved into context::run_() 2017-06-08 20:01:44 +02:00
Oliver Kowalke
cf1e529dcc fix overloads of fiber ctor for gcc 2017-06-08 20:01:44 +02:00
Oliver Kowalke
f417bee9b0 use conditional expression likely/unlikely 2017-06-08 20:01:44 +02:00
Oliver Kowalke
b50ce52581 prefetching of context in algo-implementations 2017-06-08 20:01:44 +02:00
Oliver Kowalke
68f1eb18fa correct CPU model used for perforance tests in documentation 2017-06-08 20:01:39 +02:00
Oliver Kowalke
81be60064d fiber unit-tests pass pointer instead of reference (MSVC-14.0 issue) 2017-06-08 20:00:26 +02:00
Oliver Kowalke
8bd45153cf adjust timeouts in unit-test 2017-06-08 20:00:26 +02:00
Oliver Kowalke
39aa216ca6 Merge branch 'develop' 2017-06-07 17:23:28 +02:00
Oliver Kowalke
be5f5b88fe if dequeud from remote-ready-queue test for ready
- if a context was signaled from remote, test if
  it is already in the ready-queue (might be possible
  by a timedout wait for instance)
2017-06-06 18:55:05 +02:00
Oliver Kowalke
57dd743e6c function and args no moved into context::run_() 2017-06-06 18:54:28 +02:00
Oliver Kowalke
8978964790 fix overloads of fiber ctor for gcc 2017-06-05 20:21:12 +02:00
Oliver Kowalke
81f43d6076 passing arguments 2017-06-05 16:49:47 +02:00
Oliver Kowalke
2932198f2b use conditional expression likely/unlikely 2017-06-05 16:49:47 +02:00
Oliver Kowalke
5b84692688 prefetching of context in algo-implementations 2017-06-05 16:49:47 +02:00
Oliver Kowalke
3d8bd59bd9 correct CPU modeli used for perforance tests in documentation 2017-06-05 16:49:47 +02:00