Open
Description
Created by @fpoli on 2019-01-15 15:09
Last updated on 2019-01-15 15:15
The data races reported in #256 have been quickly fixed in pull request #408 by using AtomicIntegers
.
The fix works, but several improvements are possible:
- Malte suggested to develop some kind of generic thread-safe counter or symbol generator, usable by both Silicon and Carbon.
- Fábio suggested to use, if it exists, the Scala equivalent of Java's
AtomicInteger
. - In my opinion, for the conversion of methods to CFG the global counters can be avoided entirely, by using method-local counters for
TmpLabel
andBlock
(allocating a symbol generator inCfgGenerator#methodToCfg
, and passing it as an additional parameter intoCfg
method calls). This should avoid the overhead of thread-safe counters.