Go mutex (sync.Mutex) and read / write lock (sync.RWMutex)

When do I need a lock? When there is only one thread in the program, there is no need to lock, but usually the actual code is not just a single thread, so the lock needs to be used at this time. What are the main scenarios related to the use of the lock? When multiple threads are reading the same dataWhen multiple threads write the same d ...

Posted by lazaruz on Tue, 01 Mar 2022 13:11:46 +0100

Inventory of development artifacts in Go

Python wechat ordering applet course video https://edu.csdn.net/course/detail/36074 Python actual combat quantitative transaction financial management system https://edu.csdn.net/course/detail/35475 This article has been included https://github.com/lkxiaolou/lkxiaolou Welcome, star. In Java, we use Junit as unit test, JMH as performan ...

Posted by 25lez25 on Tue, 01 Mar 2022 06:09:57 +0100

RNA 9. GO annotation of gene expression in SCI articles

The most complete GO annotation result drawing in the whole network, directly click the SCI drawing annotation, pay attention to me, your best choice! preface 1. GO principle Genome sequencing has shown that most genes that specify core biological functions are common to all eukaryotes. This knowledge can often be transferred from one organi ...

Posted by Sean_J on Tue, 01 Mar 2022 06:04:51 +0100

Standard library os package learning in GoLang

Standard library os package learning in GoLang 1.io.EOF error io.EOF is triggered when there is no readable content. For example, if a file Reader object is empty, or the file pointer points to the end after reading several times, calling Read will trigger EOF 2.perm parameter permission 3.os. O_ Constants such as rdonly const ( ...

Posted by Threepwood on Mon, 28 Feb 2022 11:25:15 +0100

Golang Protocol Buffers data format tutorial

In this article, we introduce how to use Protocol Buffers data format in Golang applications. Including the definition of Protocol Buffers and the advantages compared with traditional xml and json, and practicing through several examples. Protocol Buffers data format Protocol Buffers is a data format launched by Google. We know that json/xm ...

Posted by Nicholas Reed on Sun, 27 Feb 2022 12:22:51 +0100

Discussion system 💰 The accuracy of money

From the official account: Gopher points northMoney is a mysterious thing from ancient times. Some are strong and powerful, while others are weak and weakIn a system, especially a system related to money, money is the top priority, and the accuracy of calculation will be the theme of this paper.Why is accuracy so important"Sinking a boat w ...

Posted by djddb on Sun, 27 Feb 2022 12:09:53 +0100

[golang object oriented programming]

1, Three characteristics of object-oriented programming - encapsulation 1) Introduction 2) Quick start cases package model type person struct{ Name string age int salary float64 } //Equivalent to constructor func NewStudent(name string)*person{ return &person{ Name:name, } func (p *person)SetAge(age int){ if age>0&& ...

Posted by Drachlen on Sun, 27 Feb 2022 06:11:16 +0100

LRU and LFU algorithms (page replacement algorithm)

Difference between LRU and LFUBoth LRU and LFU are page replacement algorithms for memory management.LRU: Least Recently Used (longest time) elimination algorithm. LRU is the page that has not been used for the longest time.LFU: Least Frequently Used. LFU is the page that has been used the least times in a period of time.exampleSuppose the peri ...

Posted by whatwhat123 on Sun, 27 Feb 2022 03:47:14 +0100

bolt of a pure Go KV database

Bolt is a key value database implemented in pure go language, which supports complete ACID practical operation. Although it does not have a perfect query language like SQLite, the interface is simple and easy to use. Bolt itself manages data by using a memory mapped disk file. The logic is clear and the interface is simple and easy to use. The ...

Posted by maltech on Fri, 25 Feb 2022 02:46:20 +0100

Reflector analysis in k8s source code client go

Abstract: through this article, you can understand the process of Reflector obtaining objects from Kubernetes API through ListWatcher and storing them in the store. Later, you will study the source code of DeltaFIFO and deepen your understanding of the whole informer by combining with informer. This article is shared from Huawei cloud commun ...

Posted by Cantaloupe on Tue, 22 Feb 2022 11:07:13 +0100