[racket] thread size and creation time

From: Berthold Bäuml (berthold.baeuml at dlr.de)
Date: Sat May 11 06:17:28 EDT 2013


what is the reason that threads in Racket are so much bigger than in Gambit Scheme and take so much longer to create them? Is there possibly a way to come closer to Gambit performance or have threads in Gambit less functionality? In my little Racket test program below I get about 10kB per thread on my MacBook and creation takes about 100us per thread (Gambit claims to fit "millions of active threads in ~1GB and a creation time of 0.5us).

Marc Freely states in a talk from 2010 about Gambit http://www.iro.umontreal.ca/~gambit/Gambit-inside-out.pdf

Green threads
Preemptive scheduler with priorities
Very lightweight and scalable
Thread = descriptor (324 bytes) + continuation 
Thread creation/synchronization ~ 0.5 μs 
O(log N) enqueue/dequeue operations 
Supports millions of active threads (in ~ 1GB)


Berthold Bäuml -- Head of Autonomous Learning Robots Lab
DLR, Robotics and Mechatronics Center (RMC)
Münchner Str. 20, D-82234 Wessling
Phone +49 8153 282489

Posted on the users mailing list.