| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
This commit refactors fibers to be based on lighter-weight "tasks",
and makes the scheduler API more orthogonal. Now there are no more
fiber objects (although the fibers layer could re-add them if they are
useful), and fibers no longer have names (although again this could be
re-added at an upper layer). Also it's the current scheduler that's
bound by a parameter, not the current fiber, and as it's a thread-safe
parameter it doesn't need to be bound in each fiber.
|
| |
|
|
| |
* tests/channels.scm (pingpong): New test.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* epoll.c (scm_primitive_epoll_wait): Accept timeout in internal time
units instead of milliseconds. Avoid some overhead if the timeout is
zero.
* fibers/epoll.scm (epoll): Adapt to primitive-epoll-wait chance.
Change get-timeout callback to an "expiry" argument and an
update-expiry last-minute function. Tighten the window around the
"waiting" epoll-state.
* fibers.scm (%run-fibers): Remove current-read-waiter /
current-write-waiter parameterization, given that fibers individually
each have this parameterization.
(run-fibers): Add #:drain? argument.
* fibers/internal.scm (schedule-runnables-for-next-turn): Simplify a
bit, inlining scheduler-poll-timeout and adapting to epoll change.
(scheduler-work-pending?): New function.
(run-scheduler): Simplify finish? logic.
* tests/basic.scm:
* tests/speedup.scm: Update to drain where needed.
* fibers.texi: Update for new run-fibers termination condition.
|
| |
|
|
| |
* tests/speedup.scm: Add allocation speedup test.
|
| |
|
|
|
|
|
|
|
| |
* fibers/conditions.scm:
* tests/conditions.scm: New files.
* Makefile.am: Add new files.
* fibers.texi (Conditions): New section.
* fibers/timers.scm (sleep-operation): Rename from wait-operation.
* tests/foreign.scm: Adapt to sleep-operation change.
|
| |
|
|
| |
* tests/speedup.scm (do-times): Add different loop-to tests.
|
| |
|
|
|
| |
* tests/speedup.scm: New file.
* Makefile.am (TESTS): Add new file.
|
| |
|
|
|
|
| |
* tests/basic.scm (assert-run-fibers-terminates): Allow keyword args to
run-fibers.
(run-order, wakeup-order): Disable parallelism.
|
| |
|
|
|
|
|
|
|
|
| |
* tests/foreign.scm: New file.
* Makefile.am: Add new file.
* fibers/operations.scm (perform-operation): Support blocking operations
from foreign threads (without a scheduler).
* fibers/timers.scm (timer-sched, *timer-sched*, timer-operation): Add
support for timeouts that use an auxiliary thread instead of relying
on the current scheduler.
|
| |
|
|
|
|
|
|
|
| |
* fibers.scm (run-fibers): Require init thunk for run-fibers without a
scheduler.
(spawn-fiber): Incorporate helper procedures, remove dynamic-state
argument (as it's always the current dynamic state), and add parallel?
argument. Ensure the fiber will have the right read/write waiters.
* tests/basic.scm: Update.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* Makefile.am: Add new test.
* TODO.md: Remove stale TODO entries.
* fibers.scm (run-fibers): Add #:hz parameter.
* fibers.texi (Design): Mention that we support preemption.
(Using Fibers): Update for preemption.
* fibers/internal.scm (<scheduler>): Add hz field.
(make-scheduler): Add #:hz initarg.
(maybe-preemptive): New helper.
(run-scheduler): Use maybe-preemptive.
* tests/preemption.scm: New test.
|
| |
|
|
|
|
| |
* fibers.scm (spawn-fiber): Fibers inherit dynamic state of parent.
* tests/parameters.scm: New test.
* Makefile.am: Add new file.
|
| |
|
|
|
|
|
|
| |
* fibers/operations.scm: New file.
* fibers/channels.scm: Reimplement in terms of operations (CML events).
* tests/basic.scm: Remove channels tests.
* tests/channels.scm: Add channels tests.
* Makefile.am: Update for new files.
|
| |
|
|
| |
* tests/basic.scm (check-sleep): Add sleep duration test.
|
| |
|
|
|
| |
* tests/basic.scm (assert-run-fibers-returns): Change arg order.
(rpc, rpc-fib): Add channels tests.
|
| |
|
|
|
|
|
|
|
| |
* fibers.scm (run-fibers):
* fibers/internal.scm (run-scheduler): If there is an init thunk, keep
the scheduler running until the corresponding fiber is finished.
Return the values returned from the fiber.
* tests/basic.scm (assert-run-fibers-terminates): Return values.
(assert-run-fibers-returns): New helper. Use it.
|
| |
|
|
|
|
|
|
| |
* fibers/internal.scm (schedule-runnables-for-next-turn): Reverse
runnables queue so that fibers are run in the next turn in the order
that they were added in the previous turn.
* tests/basic.scm (run-order): Add run order and sleep wakeup order
tests.
|
| |
|
|
| |
* tests/basic.scm: Update comments.
|
|
|
* Makefile.am (TESTS, TESTS_ENVIRONMENT):
* configure.ac: Enable tests.
* tests/basic.scm: Add some tests.
|