RE: [racket-users] future question

2021-11-12 Thread Jacob Jozef
@googlegroups.comSubject: Re: [racket-users] future question Hi, you are looking for make-fsempahore[1] and related: ===#lang racket (define sema (make-fsemaphore 1)) (define (make-th i) (λ ()   (let loop ((a 0))(when (zero? (modulo a #e1e6)) (fsemaphore-wait sema) "do what you have to do without distu

Re: [racket-users] future question

2021-11-12 Thread Dominik Pantůček
Hi, you are looking for make-fsempahore[1] and related: === #lang racket (define sema (make-fsemaphore 1)) (define (make-th i) (λ () (let loop ((a 0)) (when (zero? (modulo a #e1e6)) (fsemaphore-wait sema) "do what you have to do without disturbing other futures"

[racket-users] future question

2021-11-12 Thread Jacob Jozef
Hi The following runs 100% of my CPU, but when I uncomment the when-clause nothing happens (0% CPU)(processor-count) yields 8 on my PC. #lang racket (define sema (make-semaphore 1)) (define (make-th i) (λ ()  (let loop ((a 0)) #;(when (zero? (modulo a #e1e6))    (semaphore-wait sema)    "do what