summaryrefslogtreecommitdiff
path: root/fibers (follow)
Commit message (Expand)AuthorAgeFilesLines
* create-fiber does not return the fiber•••* fibers/internal.scm (create-fiber): Don't return the fiber. Andy Wingo2016-10-121-2/+1
* Rename choose to choice•••* fibers/operations.scm (choice-operation): Rename from choose-operation. Andy Wingo2016-10-121-3/+3
* Internals twiddles•••* fibers/internal.scm (current-scheduler/public): Document. (current-fiber/public): New accessor. (resume-on-timer): Document. * fibers.scm: Adapt to use current-fiber directly from the internals. Remove kill-fiber. Andy Wingo2016-10-121-2/+14
* Rework internals resume interface•••* fibers/internal.scm (resume-on-fd-events, resume-on-readable-fd) (resume-on-writable-fd, resume-on-timer): Rework primitive resume interface. * fibers.scm: * fibers/timers.scm: Adapt users. Andy Wingo2016-10-122-16/+31
* Update documentation.Andy Wingo2016-10-124-20/+80
* Epoll handles event buffer size itself•••* fibers/epoll.scm: Internall handle `maxevents'. * fibers/internal.scm (schedule-runnables-for-next-turn): Update for epoll interface change. Andy Wingo2016-10-122-12/+18
* fiber-continuation•••* fibers/internal.scm: Rename fiber-data to fiber-continuation. Adapt all users. * fibers/repl.scm: Adapt. Andy Wingo2016-10-122-11/+11
* Minor fibers/internal cleanups.•••* fibers/internal.scm: Minor cleanups. Andy Wingo2016-10-121-7/+0
* Move wake facility to epoll module•••* fibers/epoll.scm: Move wake facility here. Note that due to a miscompilation in Guile 2.1.4, this requires a patch from Git master. * fibers/internal.scm: Adapt to change. Andy Wingo2016-10-112-88/+86
* Lighter fibers•••* fibers/internal.scm: Remove fiber-state; this is managed implicitly now by ensuring that a fiber is only resumed at most once per suspend. We no longer record fiber return values; that should be up to the fiber's init continuation. Replace scheduler inbox with making the runqueue atomic. * fibers.scm (run-fibers): Adapt to run-scheduler change. * fibers/repl.scm (fibers): Adapt to fiber-data change. Andy Wingo2016-10-112-73/+37
* Runnables refactor•••* fibers/deque.scm (empty-deque?, dequeue-all, dequeue-all!): New interfaces. (update!): New helper. (enqueue!): Use new helper. * fibers/internal.scm: Use deque instead of stack for runnables. Andy Wingo2016-10-112-27/+45
* Factor out deque implementation•••* fibers/deque.scm: Factor out to helper module. * Makefile.am: Add deque.scm. * fibers/channels.scm: Use (fibers deque). Andy Wingo2016-10-112-48/+77
* Internal channels refactor•••* fibers/channels.scm: Queue is really a deque; refer to it as such. Andy Wingo2016-10-111-27/+28
* Fix scheduler busy-waiting bug•••* fibers/internal.scm (schedule-runnables-for-next-turn): Fix bug where we were busy-waiting when there were no active fd's. Andy Wingo2016-10-031-9/+11
* Timeout CML operations•••* fibers/timers.scm: New file. * fibers/internal.scm (add-timer!): Take expiry as absolute time. * fibers.scm (fibers): Re-export sleep from (fibers timers). * Makefile.am: Adapt. Andy Wingo2016-10-032-7/+56
* Sleep refactor•••* fibers/internal.scm: Rename sleepers to timers, and be callbacks instead of waking fibers directly. * fibers.scm (sleep): Adapt. Andy Wingo2016-10-031-44/+34
* Reimplement in terms of Parallel Concurrent ML•••* 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. Andy Wingo2016-10-032-78/+457
* Add support for ,spawn-fiberAndy Wingo2016-09-202-24/+138
* Add ,fibers command.Andy Wingo2016-09-203-0/+66
* Add fibers and schedulers to namesets•••* fibers/internal.scm (fibers-nameset, schedulers-nameset): Add schedulers and fibers to namesets. Appears to slow down fiber creation by 2X; oh well? Andy Wingo2016-09-191-8/+19
* Add nameset to name fibers and schedulers•••* fibers/nameset.scm: New file. * Makefile.am (SOURCES): Add new file. Andy Wingo2016-09-191-0/+73
* Remove `sleep' export from (fibers internal)•••* fibers/internal.scm: Remove `sleep' export. Andy Wingo2016-09-111-1/+0
* run-fibers returns values from initial thread•••* 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. Andy Wingo2016-09-101-3/+6
* Better fiber run order•••* 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. Andy Wingo2016-09-091-0/+3
* Use Ian Price's priority search queues•••* fibers/psq.scm: New file, imported from Ian Price's PFDS project (https://github.com/ijp/pfds). * Makefile.am: Add new file. * fibers/internal.scm: Use a PSQ for the sleepers set instead of the list. Fixes N^2 badness, apparently. Andy Wingo2016-09-092-19/+574
* Marginal sleeper list speedup.•••* fibers/internal.scm (wake-sleepers, add-sleeper!): Speed up marginally; still quadratic. Andy Wingo2016-09-081-14/+15
* Quit the scheduler when there is nothing left to do•••* fibers/internal.scm: Detect when there is nothing left to run, and stop the scheduler in that case. * examples/ping-client.scm (client-loop): * examples/memcached-client.scm (client-loop): Remove exit call, as we will exit when needed. Andy Wingo2016-09-081-49/+79
* Enable remote fiber wakeup•••* fibers/internal.scm: When waking fibers that belong to another scheduler, arrange to do so in such a way that avoids races and makes sure that the remote scheduler wakes up from any epoll() call. Andy Wingo2016-09-071-72/+163
* Separate public and private fibers interfaces•••* fibers/internal.scm: New file, factored out of (fibers). * fibers.scm: Refactor to be just the public interface. * fibers/channels.scm: * web/server/fibers.scm: * examples/memcached-client.scm: * examples/memcached-server.scm: * examples/ping-client.scm: * examples/ping-server.scm: Adapt to interface changes. * Makefile.am (SOURCES): Add (fibers internal). Andy Wingo2016-09-072-8/+265
* Add channels implementation•••* fibers/channels.scm: New file. * fibers.scm: Add comment. * Makefile.am: Add new file. Andy Wingo2016-09-061-0/+114
* add (fibers epoll)•••* configure.ac: Add checks for sys/epoll.h, epoll_create, and epoll_create1. * epoll.c: New file. * module/ice-9/epoll.scm: New file. * module/Makefile.am: Build new files. * env.in: Add to LTDL_LIBRARY_PATH. * .gitignore: Add new built products. Andy Wingo2016-07-031-0/+111