summaryrefslogtreecommitdiff
Commit message (Expand)AuthorAgeFilesLines
* Fibers 1.0.0.•••* configure.ac: Bump version. v1.0.0Andy Wingo2017-02-201-1/+1
* Fix fibers/config.scm rule•••* Makefile.am (fibers/config.scm): Fix rule. Andy Wingo2017-02-201-0/+1
* Fibers 1.0.0 documentation.•••* fibers.texi: Update for 1.0.0. Andy Wingo2017-02-201-13/+11
* Add gitignore•••* .gitignore: Add fibers/config.scm. Andy Wingo2017-02-201-0/+1
* Update examples in manual•••* fibers.texi: Update examples and example timings. Andy Wingo2017-02-201-18/+15
* Update examples•••* examples/memcached-client.scm: * examples/memcached-server.scm: * examples/ping-client.scm: * examples/ping-server.scm: Update for newest run-fibers. Andy Wingo2017-02-204-39/+31
* Add block-asyncs in fiber->thread resume path•••* fibers/operations.scm (perform-operation): Block asyncs in resume callback; otherwise the fiber doing the resuming could be scheduled away. Andy Wingo2017-02-201-4/+6
* Update (web server fibers)•••* web/server/fibers.scm: Update for new-style nonblocking management. Andy Wingo2017-02-201-12/+7
* Add new channels test.•••* tests/channels.scm (pingpong): New test. Andy Wingo2017-02-201-0/+22
* Fix deprecation warning in (fibers operations)•••* fibers/operations.scm: Use (ice-9 threads). Andy Wingo2017-02-201-0/+5
* Fix epoll wakeup•••* fibers/epoll.scm (epoll): Like a complete idiot, I broke epoll wakeup. Fixed by calling expiry->timeout while epoll-state is waiting. Andy Wingo2017-02-201-5/+7
* Update REPL support for run-fibers changes.•••* fibers/repl.scm (fibers): Update for new run-fibers changes. Andy Wingo2017-02-201-11/+26
* Update documentation.•••* fibers.texi (Internals): Document scheduler-work-pending?. Andy Wingo2017-02-201-0/+5
* run-fibers returns when initial fiber finishes•••* 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. Andy Wingo2017-02-197-126/+148
* Fix make -j problem•••* Makefile.am ($(GOBJECTS)): Depend on epoll.la. Andy Wingo2017-02-191-0/+1
* Minor documentation update•••* fibers.texi: Bump version and date. Add words about scalability. Andy Wingo2017-02-191-2/+26
* Require Guile 2.1.7•••* README.md (Download): Update required Guile version. Andy Wingo2017-02-181-1/+1
* Lower preemption overhead•••* fibers/interrupts.scm (with-interrupts/sigprof): (with-interrupts/thread-cputime, with-interrupts): Separate predicate from interrupt routine, so that predicate can run off-thread. * fibers.scm (%run-fibers): Adapt. Andy Wingo2017-02-172-11/+14
* Prevent spurious preemption•••* fibers/internal.scm (<scheduler>, make-scheduler): (scheduler-runcount, run-scheduler): Maintain a count of run fibers. * fibers.scm (%run-fibers): Only cause the current fiber to suspend if the runcount isn't advancing. Andy Wingo2017-02-172-3/+21
* Add allocation speedup test•••* tests/speedup.scm: Add allocation speedup test. Andy Wingo2017-02-171-0/+13
* Take advantage of accept4 interface.•••* fibers/web/server.scm (client-loop): Setvbuf here. (socket-loop): Use new accept4 interface. Andy Wingo2017-02-151-2/+2
* Tweak fibers web socket options•••* fibers/web/server.scm (client-loop): Move NODELAY things here and actually enable NODELAY (before we were... disabling it???). (socket-loop): Remove SNDBUF munging; let's assume it doesn't matter rather than the reverse. Andy Wingo2017-02-151-7/+4
* Fix epoll-modify logic•••Because this case wasn't being hit before, there were bugs. * fibers/internal.scm (<scheduler>): Remove active fd count; we'll add a #:forever? option to run-fibers instead. Simplify sources. (make-scheduler): Adapt. (schedule-fibers-for-fd): Use resume callbacks, to allow for other kinds of callbacks. (scheduler-poll-timeout): Don't wait for active fd count to go to zero. (finalize-fd): Avoid mucking with hash tables from this potentially-gc callback. (add-fd-event-waiter): New function. (resume-on-fd-events): Call new function. Andy Wingo2017-02-151-66/+52
* Add epoll-add*!•••* fibers/epoll.scm (epoll-add*!): New function, tries an epoll-modify! then falls back to epoll-add!. Andy Wingo2017-02-151-1/+8
* fibers/config.scm is built source•••* Makefile.am (BUILT_SOURCES): Mark fibers/config.scm as built. Andy Wingo2017-02-151-0/+2
* Parallelize ping client and server.•••* examples/ping-client.scm: * examples/ping-server.scm: Parallelize. Andy Wingo2017-02-142-2/+4
* Fix ping-client•••* examples/ping-client.scm: Fix for run-fibers changes, to only exit when done. Andy Wingo2017-02-141-6/+10
* Fix spurious epoll traffic•••* fibers/internal.scm (schedule-fibers-for-fd): Fix sense of the POLLERR test. This was causing us to register and unregister our fd's with the kernel all the time. This was a scalability bottleneck as adding or removing an fd from an epoll set is serialized in the kernel through one mutex (!!!!), the "epmutex"; because you can nest epoll instances the kernel uses this to prevent cycles. Hint found in Voellmy's paper on the MIO system for Haskell. Andy Wingo2017-02-141-1/+1
* Minor tweak to web server•••* fibers/web/server.scm (socket-loop): Move set-nonblocking! call to client where it parallelizes better. Andy Wingo2017-02-141-2/+3
* Gracefully handle EPIPE•••* fibers/web/server.scm (client-loop): Avoid error when reading from shut-down socket (EPIPE). Perhaps a read that gives EPIPE should produce an EOF object anyway. Andy Wingo2017-02-121-3/+4
* Cope with migration of initial fiber•••* fibers.scm (run-fibers): Allow migration of main fiber. Andy Wingo2017-02-121-1/+4
* Add concurrent web server•••* fibers.texi (Concurrent Web Server): New section. * fibers/web/server.scm: Add web server that can run handlers concurrently. * examples/concurrent-web-hello.scm: New file. * Makefile.am (SOURCES): Add (fibers web server). Andy Wingo2017-02-114-7/+335
* Add condition variable implementation•••* 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. Andy Wingo2017-02-116-6/+227
* Fix channel CAS logic•••* fibers/channels.scm (put-operation, get-operation): Fix bogus CAS that could cause us to spin in an allocation loop. Andy Wingo2017-02-081-4/+4
* Prevent GC from waking up epoll•••* epoll.c (do_epoll_wait): Leave Guile to do the epoll, preventing libgc from having to interrupt us for GC. Andy Wingo2017-02-081-7/+27
* Better exception handling•••* fibers/internal.scm (create-fiber): Add a start-stack and a catch-all around the fiber thunk. Note that in practice this needs the recent post-2.1.6 patch in Guile (498f3f95684361f3591106a8f9cb9065fd649288) to work well. Andy Wingo2017-02-071-4/+17
* Update doc version.•••* fibers.texi: Update version. Andy Wingo2017-01-191-3/+3
* Fibers v0.5.0.•••* configure.ac: Bump version. * NEWS: Update. v0.5.0Andy Wingo2017-01-192-1/+12
* Update documentation.•••* fibers.texi (Using Fibers): Update. Andy Wingo2017-01-191-2/+9
* Better findability for epoll extension.•••* fibers/config.scm.in: New file. * Makefile.am: Wire up new file. * env.in: Define FIBERS_BUILD_DIR. * fibers/epoll.scm: Use (fibers config) to get dir for epoll extension. Andy Wingo2017-01-194-1/+44
* Randomized round-robin work sharing/stealing•••* fibers.scm (start-auxiliary-threads, stop-auxiliary-threads): Adapt to scheduler-remote-peers change. (spawn-fiber): Adapt to use choose-parallel-scheduler. * fibers/internal.scm (<scheduler>): Add choose-parallel-scheduler field. (shuffle, make-selector): New helpers. (make-scheduler): Adapt to initialize choose-parallel-scheduler field. (choose-parallel-scheduler): New public function. (run-scheduler): Use fiber-stealer. Andy Wingo2017-01-182-63/+76
* More speedup tests.•••* tests/speedup.scm (do-times): Add different loop-to tests. Andy Wingo2017-01-181-3/+7
* Add test for parallel speedup.•••* tests/speedup.scm: New file. * Makefile.am (TESTS): Add new file. Andy Wingo2017-01-182-1/+57
* Pin worker threads to CPUs if appropriate•••* fibers.scm (with-affinity): New helper. (%run-fibers): Add affinity argument. (start-auxiliary-threads): Add affinities argument. (compute-affinities): New helper. (run-fibers): If the parallelism is complete, pin threads to CPUs. Andy Wingo2017-01-171-21/+58
* Update TODOAndy Wingo2017-01-081-4/+0
* Update documentation•••* fibers.texi: Update. Andy Wingo2017-01-081-85/+211
* Disable parallelism in scheduling-order tests•••* tests/basic.scm (assert-run-fibers-terminates): Allow keyword args to run-fibers. (run-order, wakeup-order): Disable parallelism. Andy Wingo2017-01-081-4/+4
* create-fiber always captures dynamic state•••* fibers/internal.scm (create-fiber): Remove dynamic-state argument; always capture the current dynamic state. * fibers/timers.scm (timer-operation): * fibers.scm (spawn-fiber): Adapt. Andy Wingo2017-01-083-13/+12
* Enable preemption by default•••* fibers.scm (run-fibers): Enable preemption by default with a period of 10ms. Andy Wingo2017-01-081-3/+2
* Peer schedulers share a prompt tag•••* fibers/internal.scm (make-scheduler): Peer schedulers share a prompt tag. This eliminates TOCTTOU bugs in suspend-current-fiber when computing the suspension prompt tag. (run-scheduler): Inline run-fiber and just use the same prompt tag for all fibers. Andy Wingo2017-01-081-15/+17