From 4261a4b195eb8ec3aca1a1f5419508268a25f12a Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Wed, 13 Jan 2016 22:50:09 -0500 Subject: [PATCH] Debugging --- examples/threading/many-writers.scm | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/examples/threading/many-writers.scm b/examples/threading/many-writers.scm index 1c91cb19..9e08c2e1 100644 --- a/examples/threading/many-writers.scm +++ b/examples/threading/many-writers.scm @@ -5,19 +5,32 @@ (srfi 18)) ;; should not be necessary, just testing -(define m (make-mutex)) +;; TODO: noticed gc_move error with mutex... may be a GC issue +;(define m (make-mutex)) (define (write-forever val) - (mutex-lock! m) +; (mutex-lock! m) (write val) - (mutex-unlock! m) +; (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"))) +(thread-start! + (make-thread + (make-writer 'thread-2))) +(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)