mirror of
https://github.com/justinethier/cyclone.git
synced 2025-05-23 20:15:05 +02:00
Debugging
This commit is contained in:
parent
addf25eec9
commit
4261a4b195
1 changed files with 17 additions and 4 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue