diff options
author | Ibrahim Mkusa <ibrahimmkusa@gmail.com> | 2017-04-13 14:09:40 -0400 |
---|---|---|
committer | Ibrahim Mkusa <ibrahimmkusa@gmail.com> | 2017-04-13 14:09:40 -0400 |
commit | 2c8407d195bef9219aad357bc2a327c392d38e1a (patch) | |
tree | 88e62756ed7eb747fafd9ee294841b276b9019cb | |
parent | a0fbba4a81b0ebc4819c3413a8bf06ae0d3aeb5c (diff) |
tidied up, removed some unused definitions
-rw-r--r-- | Hermes/TODO (renamed from Hermes/TODO.txt) | 0 | ||||
-rw-r--r-- | Hermes/server.rkt | 9 |
2 files changed, 2 insertions, 7 deletions
diff --git a/Hermes/TODO.txt b/Hermes/TODO index c1f17fa..c1f17fa 100644 --- a/Hermes/TODO.txt +++ b/Hermes/TODO diff --git a/Hermes/server.rkt b/Hermes/server.rkt index 216c6e2..59f33d2 100644 --- a/Hermes/server.rkt +++ b/Hermes/server.rkt @@ -1,8 +1,6 @@ #lang racket (require math/base) ;; for random number generation -;; TODO wrap "safer send in a function that takes care of semaphores" - ;; globals ; track number of connections with closure (define (make-count no-count) @@ -20,6 +18,7 @@ [(eq? m 'current-count) current-count])) dispatch) (define c-count (make-count 0)) +; a semaphore to control access to c-count (define c-count-s (make-semaphore 1)) @@ -38,7 +37,7 @@ [(eq? m 'add) add])) dispatch) (define c-connections (make-connections '())) - +; a semaphore to control acess to c-connections (define connections-s (make-semaphore 1)) ;; control access to connections ;; every 5 seconds run to broadcast top message in list @@ -46,10 +45,6 @@ (define messages-s (make-semaphore 1)) ;; control access to messages (define messages '()) ;; stores a list of messages(strings) from currents -(define threads-s (make-semaphore 1)) ;; control access to threads -;; lets keep thread descriptor values -(define threads '()) ;; stores a list of client serving threads as thread descriptor values - ;; Several threads may want to print to stdout, so lets make things civil (define stdout (make-semaphore 1)) |