.
original commit: 314d99f90aaa541dad8b67b7add0ede20357dcd9
This commit is contained in:
parent
c3170d6181
commit
8c25972909
|
@ -3,8 +3,8 @@
|
|||
|
||||
(define source-dir (current-load-relative-directory))
|
||||
|
||||
(define num-times 8)
|
||||
(define num-threads 3)
|
||||
(define num-times 10)
|
||||
(define num-threads 6)
|
||||
|
||||
(define dump-stats? #f)
|
||||
|
||||
|
@ -196,16 +196,27 @@
|
|||
(define (stw t n)
|
||||
(thread-weight t (floor (/ (thread-weight t) n))))
|
||||
|
||||
(define (breakable t)
|
||||
(if #t
|
||||
(thread (lambda ()
|
||||
(read)
|
||||
(printf "breaking~n")
|
||||
(break-thread t)
|
||||
(thread-wait t)
|
||||
(printf "done~n")))
|
||||
(void)))
|
||||
|
||||
(define (do-test)
|
||||
(let ([sema (make-semaphore)])
|
||||
(let loop ([n num-threads])
|
||||
(unless (zero? n)
|
||||
(breakable
|
||||
(thread (lambda ()
|
||||
(stw (current-thread) n)
|
||||
(dynamic-wind
|
||||
void
|
||||
(lambda () (maker n num-times))
|
||||
(lambda () (semaphore-post sema)))))
|
||||
(lambda () (semaphore-post sema))))))
|
||||
(loop (sub1 n))))
|
||||
(let loop ([n num-threads])
|
||||
(unless (zero? n)
|
||||
|
|
Loading…
Reference in New Issue
Block a user