diff options
| author | Andy Wingo <wingo@pobox.com> | 2017-02-14 22:24:10 +0100 |
|---|---|---|
| committer | Andy Wingo <wingo@pobox.com> | 2017-02-14 22:24:10 +0100 |
| commit | 4c90c40ff21452b72c8f03bed6036d6ac86e1d76 (patch) | |
| tree | 948915471015c3ddda07cdaf07e304fac61cb708 /examples | |
| parent | Fix ping-client (diff) | |
| download | guile-fibers-4c90c40ff21452b72c8f03bed6036d6ac86e1d76.tar.gz | |
Parallelize ping client and server.
* examples/ping-client.scm:
* examples/ping-server.scm: Parallelize.
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/ping-client.scm | 3 | ||||
| -rw-r--r-- | examples/ping-server.scm | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/examples/ping-client.scm b/examples/ping-client.scm index b2b3db2..8687656 100644 --- a/examples/ping-client.scm +++ b/examples/ping-client.scm @@ -64,7 +64,8 @@ (spawn-fiber (lambda () (client-loop addrinfo n num-connections) - (put-message ch 'done))) + (put-message ch 'done)) + #:parallel? #t) ch)) (iota num-clients))))) diff --git a/examples/ping-server.scm b/examples/ping-server.scm index 7692a33..d2873e3 100644 --- a/examples/ping-server.scm +++ b/examples/ping-server.scm @@ -55,7 +55,8 @@ (set-nonblocking! client) ;; Disable Nagle's algorithm. We buffer ourselves. (setsockopt client IPPROTO_TCP TCP_NODELAY 0) - (spawn-fiber (lambda () (client-loop client addr store))) + (spawn-fiber (lambda () (client-loop client addr store)) + #:parallel? #t) (loop))))) (define* (run-ping-server #:key |
