Not a real issue, but maybe an idea: should we use a lock within printf to avoid scrambling characters between different threads?