(bind-func divide-and-conquer
(lambda (cnt:i32)
(spawn (lambda ()
(printf "cnt:%d thread:%p\n" cnt (thread_self))
(thread_sleep 1 0) ;; sleep for a second
(if (> cnt 0)
(begin (divide-and-conquer (- cnt 1))
(divide-and-conquer (- cnt 1))))
void))
void))