Deep Understanding Go-Memory Allocation

Go language built-in runtime (runtime), abandoned the traditional way of memory allocation, changed to autonomous management, initially based on tcmalloc, although the later changes are relatively large. Using autonomous management can achieve better memory usage patterns, such as memory pools, pre-allocation, etc., thus avoiding the performanc ...

Posted by neon on Thu, 15 Aug 2019 06:11:13 -0700

[Go Tutorial Series Notes] Interface Part 1

Catalog The first part of the Go tutorial series Notebook Interface Part 2 of the Go tutorial series Notebook Interface Go tutorial series notes concurrent introduction Go tutorial series notes goroutine Go tutorial series notes Channel channel Go Tutorial Series Note Buffer Channel and Work Pool Go Tutorial Series Notes Select Go tutorial ser ...

Posted by SuNcO on Wed, 14 Aug 2019 01:15:21 -0700

net Package--Reading Abstracts

brief introduction In the net package, there are many structures, various functions and methods. I decided to go through it on the whole and make a map. Copy and paste source: https://studygolang.com/stati... constant const ( IPv4len = 4 IPv6len = 16 ) global variable Commonly used IPv4 address. var ( IPv4bcast = IPv4(255, 255, ...

Posted by notsleepy on Mon, 12 Aug 2019 05:30:27 -0700

Source analysis of sync.Mutex in golang

The go language takes concurrency as one of its characteristics, and concurrency will inevitably lead to competition for resources. At this time, we need to use the sync.Mutex mutex provided by go to ensure that access to critical resources is mutually exclusive. Since this lock is often used, you can understand what scenarios and features this ...

Posted by gurjit on Sun, 11 Aug 2019 21:28:01 -0700

Realization of golang double linked list

Realization of Double Link List Basic concepts Each node stores pointers to the previous and next nodes Ideas for Realization Create a node structure Each node has a pointer to the upper node and a pointer to the lower node. Each node has a key => value Create a linked list structure Link List Capacity Size Attribute Link List Size Attrib ...

Posted by mrmigu on Sun, 11 Aug 2019 21:26:15 -0700

Go-User Information and System Files/Directories

7.1. Obtaining Operating System User Information (1) os package and subpackage function os/exec package, responsible for executing external commands Access to input information by os/singal os/user queries user accounts by rank or ID (2) User structure is provided in os/user to represent operating system users Uid user id Group id of ...

Posted by youdontmeanmuch on Sat, 10 Aug 2019 01:58:42 -0700

Custom Protocol and Golang Implementation

Write here is to make a summary for easy viewing when forgetting, and if there are mistakes in the article, please spray me haha, welcome to correct. It would be nice to help others. Agreement The so-called protocol is to specify a series of rules that enable the two or more parties who want to communicate to communicate normally. If we speak C ...

Posted by devil_online on Tue, 06 Aug 2019 04:14:07 -0700

A Brief Analysis of Golang Sync.Pool

sync pool uses a buffer to store temporary variables, but this buffer is not reliable. Every time a gc is used, the buffer is cleared first. So if a slice is only stored in a Pool and no other reference is made, it will be cleared as garbage. concept A Pool is a set of temporary objects that may be individually saved and retrieved.Any item stor ...

Posted by andylai on Sun, 04 Aug 2019 23:08:04 -0700

Coly of the Go Crawler goes from getting started to not giving up the guide

Recently, I found that there were fewer and fewer questions I knew I was interested in, so I was ready to aggregate technical questions and answers from other platforms, such as segmentfault, stackoverflow, and so on. To accomplish this work, there must be crawlers.I stopped by to study colly, a crawler framework for Go. Overview Coly is a well ...

Posted by Cynthia Blue on Sun, 04 Aug 2019 09:17:42 -0700

Lexical Analysis and Parsing of Go Translation Part Three

Author: Adam Presley | Address: https://adampresley.github.io... Translator's Preface Recently, I found that my translation is more and more casual. At first, when I translated articles, I was more restrained. Now I emphasize more on readability. For example, some words which have no effect on the main idea of the article will be skipped direct ...

Posted by mr9802 on Wed, 31 Jul 2019 23:04:55 -0700