From 3bec25ce266aef848fb2a87b9a9ee33ab80566b0 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 8 Nov 2014 10:26:42 -0800 Subject: 262 --- mu.arc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mu.arc b/mu.arc index ef5cb539..d9d6321b 100644 --- a/mu.arc +++ b/mu.arc @@ -869,9 +869,9 @@ ((val tagged-value) <- arg) { begin ((full boolean) <- full? (chan channel)) + ; race condition: might unnecessarily sleep if consumer routine reads from + ; channel between previous check and the set to watch below (break-unless (full boolean)) - ; todo: race condition: what if consumer routine reads between previous - ; instruction and next? ((watch boolean-address) <- get-address (chan channel) (read-watch offset)) ((watch boolean-address deref) <- copy (nil literal)) (sleep (watch boolean-address)) @@ -896,9 +896,9 @@ ((chan channel) <- arg) { begin ((empty boolean) <- empty? (chan channel)) + ; race condition: might unnecessarily sleep if consumer routine writes to + ; channel between previous check and the set to watch below (break-unless (empty boolean)) - ; todo: race condition: what if producer routine writes between previous - ; instruction and next? ((watch boolean-address) <- get-address (chan channel) (write-watch offset)) ((watch boolean-address deref) <- copy (nil literal)) (sleep (watch boolean-address deref)) -- cgit 1.4.1-2-gfad0