In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article will explain in detail how to remove the write barrier in golang garbage collection. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
First of all, it is stated that golang has not directly implemented the removal of the write barrier, and the memory write barrier of golang is a transition from the insert write barrier to the mixed write barrier. However, although golang never directly uses the delete write barrier, the mixed write barrier uses the idea of removing the write barrier.
Remove write barriers: also known as snapshot-based solutions (snapshot-at-the-begining). As the name implies, before you start gc, you must STW and take an initial snapshot of the entire root. When the assignment (business thread) removes a white pointer from a gray or white object, the write barrier captures this behavior and notifies the recycler of this behavior. In this way, solutions based on starting snapshots conservatively treat their target objects as living objects, so that there are absolutely no objects that are mistakenly recycled, but there is a risk that the scanning workload will be magnified by floating. The term is to track the regression of the wavefront.
A prerequisite for removing the write barrier (the write barrier based on the starting snapshot) is to scan the entire root at the beginning, so that all reachable objects are protected by gray (the root is black, the next level is all gray on the heap). Then use the delete write barrier to capture memory write operations to ensure that weak tricolor variants are not destroyed, which can ensure the correctness of garbage collection.
The pseudo code is as follows:
Atomic Write (src, I, ref) shade (src [I]) src [I]
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.