[racket] thread execution granularity?

From: Rüdiger Asche (rac at ruediger-asche.de)
Date: Fri Feb 17 09:04:09 EST 2012

according to the Racket docs, the smallest amount of time a thread can  
be put to sleep is 1 second. I need a finer granularity than that...  
if I had access to the thread priority, I might just have the thread  
poll the timer on low priority, but I haven't found a way to do that.

What I need to do eventually is call some (simple, mutual exclusion is  
not an issue) code periodically but in a complex application context.  
I can't rely on the application to do that cooperatively, so it must  
take place in a secondary thread, but the period must be smaller than  
a second (ideally I would be able to go down to millisecond  
granularity but if necessary something like 50 ms would suffice).

Any ideas how to accomplish that?


Posted on the users mailing list.