In G1 we pass around the G1ParScanThreadState during evacuation and the code might be simplified by storing it in thread locals.
In zgc the class ZThread is used to keep some thread local data for workers and we can look at that for inspiration, but we also have the GCThreadLocalData (currently storing the SATBMarkQueue and the G1DirtyCardQueue for G1) which can be used.
In zgc the class ZThread is used to keep some thread local data for workers and we can look at that for inspiration, but we also have the GCThreadLocalData (currently storing the SATBMarkQueue and the G1DirtyCardQueue for G1) which can be used.