Abstract
We propose “thread resumption barriers” to avoid a long pause time of program execution at the beginning of each garbage collection cycle in multi-threaded environments. Traditional snapshot garbage collectors stop all threads and scan their stacks at the beginning of each garbage collection cycle. Therefore, when there are many threads, the program pauses for a long time at the beginning. In this paper, we propose a garbage collection scheme which scans only the stack of the current thread at the beginning and later scans other stacks one at a time. In order to prevent a thread from running with its stack unscanned, when an “unscanned” thread is about to resume, its stack is scanned by the thread resumption barrier. Although Azatchi et al. have also proposed a garbage collection which scans stacks one at a time, we can easily determine when the next garbage collection cycle should be triggered in our scheme. We implemented and evaluated this garbage collection scheme. The results of performance measurements show that the program pause time can be reduced to a practical range even with a large number of threads.