#Golang-Concurrent

18 articles

Channel Introduction to Golang

Channel Introduction to Golang

A channel is a link from one goroutine to another and this channel is synchronous because of blocking data processes. Channels can be defined as variables with the keyword chan. This variable has the task of sending and receiving data.

Introduction of Go Routine on Golang

Introduction of Go Routine on Golang

Use go-routine when the process to be executed as a goroutine must be wrapped in a function. When calling the function, the go command is added in front of it. Thus the process will be detected as a new goroutine.

How to Implement Golang's Singleton Design Pattern

How to Implement Golang's Singleton Design Pattern

Basic Definition

Singleton is a software design standard. This standard guarantees the existence of only one instance of a class, while maintaining a global point of access to its objects.

Creating a Simple Distibuted Search Engine Using Worker Pool on Golang

Creating a Simple Distibuted Search Engine Using Worker Pool on Golang

Introduction

You know Google is a place where we search for several keywords that can produce various millions of information that we can get just by typing a few keywords and in less than 1 second we can already get various information related to the keywords we are looking for. This is an example of a miniature or simple search engine version of how we can implement a worker pool into an engine that is useful for searching.

Concurrency Worker Pool Implementation on Golang

Concurrency Worker Pool Implementation on Golang

Basic Definition

A Worker pool is a goroutine management technique in concurrent programming in Go-Lang with powerfull processes. A number of workers are executed and each has the same task of completing a number of jobs. With this worker pool method, the use of memory and program performance will be optimized.

How to Implement Concurrency Pattern Fan In and Fan Out on Golang

How to Implement Concurrency Pattern Fan In and Fan Out on Golang

Channels in Go

Creating concurrent programs in Go has a unique approach to handle and to implementation when we want share memory to communication. The approach is to share memory by communicating, instead of communicating by sharing memory which is not allowed in Go. This approach can be done by using channels that can be used by goroutines to communicate with each other.