Tag:goroutine

  • Four sections of code to get started with Go and channel!

    Time:2019-8-8

    Write a simple program that allows a program to write data to a channel, and a program to read data. import ( “fmt” “strconv” “testing” ) /** In this example, we have – A message acts as a channel – A protocol is used to send messages – The main coprocess is used to receive […]

  • Implementation of a Block Chain in Go Language

    Time:2019-8-8

    This paper will gradually dismantle several steps to realize the function of block chain. The basic knowledge you need to master: What is Block Chain Sha256 hash encryption algorithm Go language foundation, including understanding of go routine and channel Dead work Go get github.com/davecgh/go-spew/spew spew is a very good print output tool, which can output […]

  • Deep understanding of Go routine

    Time:2019-7-20

    The greatest feature of the Go language is that it supports concurrency at the language level. Goroutine is the most basic execution unit in Go. In fact, every Go program has at least one Goroutine: the main Goroutine. When the program starts, it will be created automatically. To better understand Goroutine, let’s talk about the […]

  • How to manage Goroutine

    Time:2019-3-23

    Why do you need to manage Goroutines efficient use of resources Although in the Golang program, usinggo funcThe way to open agoroutineCo-operation is a very lightweight operation. However, arbitrary creation without any consideration will result in a lot of waste of resources. Although golang itself provides GC functionality, GC release takes time. Through more rational […]