เส้นทางการเรียนรู้

Concurrency ใน Go

Goroutine, channel, select, Mutex, worker pool และ context

บทเรียน 6 บท · โจทย์ 6 ข้อ

  1. บทเรียน โจทย์ 1 ข้อ Goroutines and WaitGroup Start lightweight threads with go and wait for them with sync.WaitGroup.
  2. บทเรียน โจทย์ 1 ข้อ Channels Send values between goroutines with channels, buffered and unbuffered.
  3. บทเรียน โจทย์ 1 ข้อ Select and Timeouts Wait on several channels at once and stop waiting after a timeout.
  4. บทเรียน โจทย์ 1 ข้อ Mutex: Protecting Shared Data Let several goroutines change one value safely with sync.Mutex.
  5. บทเรียน โจทย์ 1 ข้อ Worker Pool Share a queue of jobs between a fixed number of goroutines.
  6. บทเรียน โจทย์ 1 ข้อ Context: Cancellation and Deadlines Stop work that takes too long or is no longer needed with context.