Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (use srfi-18)
- (define do-random
- (lambda ()
- (let ((getalleke (+ 1 (random 5)))
- (thread-sleep! getalleke)
- (display getalleke)
- (newline)
- ))))
- (define thread1 (make-thread! do-random))
- (define thread2 (make-thread! do-random))
- (define thread3 (make-thread! do-random))
- (define thread4 (make-thread! do-random))
- (define thread5 (make-thread! do-random))
- (thread-start! thread1)
- (thread-start! thread2)
- (thread-start! thread3)
- (thread-start! thread4)
- (thread-start! thread5)
- (thread-join! thread1)
- (thread-join! thread2)
- (thread-join! thread3)
- (thread-join! thread4)
- (thread-join! thread5)
- (display "finished")
- (exit)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement