From d0bce4a15e881960a190e0f56b0c8e2097aa3584 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Thu, 14 Jan 2016 23:34:19 -0500 Subject: [PATCH] Cleaned up demo --- examples/threading/many-writers.scm | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/examples/threading/many-writers.scm b/examples/threading/many-writers.scm index 9e08c2e1..4daeea2e 100644 --- a/examples/threading/many-writers.scm +++ b/examples/threading/many-writers.scm @@ -1,27 +1,17 @@ +;; Simple example demonstrating many threads concurrently writing data to stdout (import (scheme base) (scheme read) (scheme write) (srfi 18)) -;; should not be necessary, just testing -;; TODO: noticed gc_move error with mutex... may be a GC issue -;(define m (make-mutex)) - (define (write-forever val) -; (mutex-lock! m) (write val) -; (list 1) -; (mutex-unlock! m) (write-forever val)) (define (make-writer val) (lambda () (write-forever val))) -;; Try moving closures to heap prior to using threads -;; TODO: needed? -(Cyc-minor-gc) - (thread-start! (make-thread (make-writer "thread 1"))) @@ -31,6 +21,5 @@ (thread-start! (make-thread (make-writer 'thread-3))) -;; TODO: when main runs the process crashes, but otherwise it seems stable. WTF? ((make-writer 'main)) -(read) +;(read)