#Concurrency

4 articles

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.