Go ~ concurrent programming runtime, workerPool, timer, ticker, sync, atomic

preface Some concepts of concurrency Processes and threads A. Process is an execution process of a program in the operating system. The system is an independent unit for resource allocation and scheduling. B. Thread is an executive entity of a process. It is the basic unit of CPU scheduling and dispatching. It is a smaller basic unit t ...

Posted by vaibhavs on Sun, 27 Mar 2022 17:48:38 +0300

Introduction to Go - detailed explanation of defer

Introduction to Go (5) -- detailed explanation of defer The keyword defer allows you to postpone the execution of a statement or function until before the function returns (or after the return statement is executed anywhere). The return statement can also contain some operations, so there may be a need to postpone the statement after return. Th ...

Posted by yonta on Sun, 27 Mar 2022 02:32:00 +0300

Functions of GO language

catalogue 1. Basic function Example 1 Example 2 Example 3 2. Function parameters pass by value Reference passing Variable parameters of function 3. Function as argument 4. Callback function 5. Functional closure 6. Function method Example -- calculate the circle area A function is a basic block of code used to perform a task. ...

Posted by ridiculous on Sat, 26 Mar 2022 08:05:05 +0300