Working with Concurrency in Go (Golang)
Learn the advantages and pitfalls of concurrent programming with the Go programming language
Lo que serás capaz de hacer
Go, often referred to as Golang, is well-known for making it remarkably easy to work with concurrency. In order to make a particular function run concurrently, all we have to do is prepend the word "go" to the function call, and it cheerfully runs in the background, as a GoRoutine. Go's built in scheduler takes are of making sure that a given GoRoutine runs when it should, and as efficiently as it can. However, this does not mean that working with concurrency is simple in Go—thread safe programming takes careful planning, and most importantly it requires that developers have an absolutely solid understanding of how Go deals with concurrency. In the standard library, Go offers us several ways of dealing with concurrently running parts of our program, right in the standard library: sync.WaitGroup , which lets us wait for tasks to finish; sync.Mutex , which allows us to lock and unlock resources, so that no two GoRoutines can access the same memory location at the same time; and finally, Channels , which allow GoRoutines to send and receive data to and from each other. Go's approach to concurrency is fairly straightforward, and is more or less summed up this mantra: Don't communicate by sharing memory; instead, share memory by communicating. Channels are the means by which we usually share memory by communicating. In this course, we'll cover the use of WaitGroups, Mutexes, and Channels, and we'll do so in detail. We'll also cover some of the problems inherent in concurrency, including early program termination and race conditions. Initially, we'll gain a good understanding of how these things work by solving some of the classic problems found in the field of computer science, including the Dining Philosophers , the Producer/Consumer problem, and the Sleeping Barber . These problems are classics for a reason: they force a developer to figure out the best approach to working with code that run concurrently, or in parallel. Finally, we'll finish the course out with a more "real-world" problem, where we have to register a customer for some kind of subscription service, and take care of invoicing, registration, and all the things necessary to get a new customer up and running. We'll do so, naturally, as quickly as we can by dividing the necessary tasks up into smaller tasks, and having them run concurrently. Please note that this course requires you to download Docker Desktop from Docker. If you are a Udemy Business user, please check with your employer before downloading software.
- Learn about the various ways Go makes working with concurrent programing simple
- Understand how concurrency works, and its advantages and pitfalls
- Learn how WaitGroups, Mutexes, and channels work
- Master concurrency by working with classic computer science problems, and by building a real-world example
Temario
UNIDAD 1 - Introduction · 7 leccionesUNIDAD 1 - Introduction
UNIDAD 1 - Introduction
- Introduction
- A bit about me
- Installing Go
- Installing Visual Studio Code
- Installing Make
- Asking for help
- Mistakes: we all make them.
UNIDAD 2 - Goroutines, the go keyword, and WaitGroups · 6 leccionesUNIDAD 2 - Goroutines, the go keyword, and WaitGroups
UNIDAD 2 - Goroutines, the go keyword, and WaitGroups
- What we'll cover in this section
- Creating GoRoutines and identifying a problem
- WaitGroups to the rescue
- Writing tests with WaitGroups
- Challenge: working with WaitGroup
- Solution to Challenge
UNIDAD 3 - Race Conditions, Mutexes, and an Introduction to Channels · 12 leccionesUNIDAD 3 - Race Conditions, Mutexes, and an Introduction to Channels
UNIDAD 3 - Race Conditions, Mutexes, and an Introduction to Channels
- What we'll cover in this section
- Race Conditions: an example
- Adding sync.Mutex to our code
- Testing for race conditions
- A more complex example
- Writing a test for our weekly income project
- Producer/Consumer - Using Channels for the first time
- Getting started with the Producer - the pizzeria function
- Making a pizza: the makePizza function
- Finishing up the Producer code
- Creating and running the consumer: ordering a pizza
- Finishing up our Producer/Consumer project
UNIDAD 4 - A Classic Problem: The Dining Philosophers · 6 leccionesUNIDAD 4 - A Classic Problem: The Dining Philosophers
UNIDAD 4 - A Classic Problem: The Dining Philosophers
- What we'll cover in this section
- Getting started with the problem
- Implementing the diningProblem logic
- Challenge: Printing out the order in which the meal is finished
- Solution to challenge
- Writing a test for our program
UNIDAD 5 - Channels, and another classic: The Sleeping Barber problem · 10 leccionesUNIDAD 5 - Channels, and another classic: The Sleeping Barber problem
UNIDAD 5 - Channels, and another classic: The Sleeping Barber problem
- What we'll cover in this section
- Introduction to channels
- The select statement
- Buffered Channels
- Getting started with the Sleeping Barber project
- Defining some variables, the barber shop, and getting started with the code
- Adding a Barber
- Starting the barbershop as a GoRoutine
- Sending clients to the shop
- Trying things out
UNIDAD 6 - Final Project - Building a Subscription Service · 15 leccionesUNIDAD 6 - Final Project - Building a Subscription Service
UNIDAD 6 - Final Project - Building a Subscription Service
- What we'll cover in this section
- Setting up a simple web application
- Setting up our Docker development environment
- Adding postgres
- Setting up a Makefile
- Adding sessions & Redis
- Setting up the application config
- Setting up a route & handler for the home page, and starting the web server
- Setting up templates and building a render function
- Adding session middleware
- Setting up additional stub handlers and routes
- Implementing graceful shutdown
- Populating the database
- Adding a data package and database models
- Implementing the login/logout functions
UNIDAD 7 - Sending Email Concurrently · 8 leccionesUNIDAD 7 - Sending Email Concurrently
UNIDAD 7 - Sending Email Concurrently
- What we'll cover in this section
- Getting started with the mailer code
- Building HTML and Plain Text messages
- Sending a message (synchronously)
- Getting started sending a message (asynchronously)
- Writing a helper function to send email easily
- Sending an email on incorrect login
- Adding cleanup tasks to the shutdown() function
UNIDAD 8 - Registering a User and Displaying Plans · 8 leccionesUNIDAD 8 - Registering a User and Displaying Plans
UNIDAD 8 - Registering a User and Displaying Plans
- What we'll cover in this section
- Adding mail templates and URL signer code
- Starting on the handler to create a user
- Activating a user
- Giving user data to our templates
- Displaying the Subscription Plans page
- Adding a route and trying things out for the "Plans" page
- Writing a stub handler for choosing a plan
UNIDAD 9 - Adding Concurrency to Choosing a Plan · 5 leccionesUNIDAD 9 - Adding Concurrency to Choosing a Plan
UNIDAD 9 - Adding Concurrency to Choosing a Plan
- What we'll cover in this section
- Getting the plan id, the plan, and the user
- Generating an Invoice
- Generating a manual
- Trying things out, subscribing a user, updating the session, and redirecting
UNIDAD 10 - Testing · 9 leccionesUNIDAD 10 - Testing
UNIDAD 10 - Testing
- What we'll cover in this section
- Setting up our tests
- Testing Routes
- Testing the Renderer
- Modifying the data package to make it testable
- Implementing the PlanTest type
- Getting started testing Handlers
- Testing the Login Handler
- Testing a handler that uses concurrency
Tu certificado lo emite la SEP, no solo una plataforma
Al demostrar la competencia recibes un certificado emitido por la Secretaría de Educación Pública a través del Gobierno del Estado de México: un documento oficial que puedes presentar con confianza ante cualquier empleador o institución.
Tu certificado con INEC
- Lo emite la Secretaría de Educación Pública (SEP), a través del Gobierno del Estado de México
- Documento oficial con folio verificable en línea
- Lo otorga la Universidad Tecnológica Fidel Velázquez
Otras plataformas en línea
- Constancia privada emitida por la misma plataforma
- Solo acredita horas cursadas o asistencia
- Sin respaldo de una autoridad educativa
Tu itinerario, de la inscripción al certificado
- 1
Inscripción con pago único
Pagas $2,800 MXN una sola vez y entras de inmediato al curso.
- 2
Estudias a tu ritmo
10 unidades con videos, lecturas y actividades, disponibles 24/7 durante 12 meses.
- 3
Cuestionarios por unidad
Cuestionarios para comprobar lo aprendido.
- 4
Certificado
Emitido por la SEP a través del Gobierno del Estado de México, con folio verificable.
Un certificado oficial de la SEP
- Emitido por la Secretaría de Educación Pública (SEP), a través del Gobierno del Estado de México. No es una constancia privada: es un documento oficial, y ese respaldo marca la diferencia frente a otras plataformas en línea.
- Contenido impartido por Trevor Sawler.
- Folio y QR verificables para compartirlo con quien te contrate.
Empieza hoy, a tu ritmo
Un solo pago y acceso inmediato al curso completo durante 12 meses.
- 10 unidades · 86 lecciones · 50 h
- 12 meses de acceso
- Certificado emitido por la SEP (Gob. del Estado de México) con folio verificable
Sobre tu inscripción
¿Cómo es el pago?
Un solo pago de $2,800 MXN. No hay mensualidades ni cargos recurrentes.
¿Cuánto tiempo tengo acceso?
12 meses desde tu inscripción, 24/7, para avanzar a tu ritmo.
¿Quién imparte el contenido?
El curso es impartido por Trevor Sawler; INEC gestiona tu inscripción, evaluación y certificado.
¿Qué pasa cuando vence mi acceso?
Puedes renovar tu cuenta tú mismo desde la plataforma, sin trámites ni esperas.


