[MLton] Int.fmt thread unsafe? (YUCK)

Henry Cejtin henry.cejtin@sbcglobal.net
Thu, 09 Mar 2006 14:01:52 -0600


Aren't the Int*.fmt functions clearly thread unsafe?  I.e., if I use some
pre-emptive threading, and a context switch happens while I am converting an
int to characters, and if the thread I switch to does a conversion of the
same size int, then when the suspended thread is resumed, the buf array
is going to contain garbage.

(Please, it would be a big loss to make the code thread safe even when no
threads are being used and I would hate to lose out, but the current code
clearly seems wrong to me.)