On Wednesday, 29 November 2017 at 16:13:13 UTC, Wanderer wrote: > static void getId(shared IdGen!(MyId)* g) > { > writeln("next: ", g.next()); > writeln("next: ", g.next()); > } writeln synchronizes on stdout, so your code is mostly serialized, good example of a very subtle race condition.