Concurrency made easy - GopherCon SG 2017

  Рет қаралды 25,941

Singapore Gophers

Singapore Gophers

Күн бұрын

Пікірлер: 10
@wangfenjin
@wangfenjin 6 жыл бұрын
For why close the error channel: Because if you don't close the error channel, the last return statement maybe blocked forever if there is no value in the chan. Receive from a closed chan will return immediately even if it's empty.
@able2663
@able2663 2 жыл бұрын
nice sharing.
@mikei4min
@mikei4min 7 жыл бұрын
By the way Dave Cheney is a great author - dave.cheney.net/!
@FrenchPirate83
@FrenchPirate83 6 жыл бұрын
Minor, but could sem not have been a chan struct{} instead of a chan int?
@欧阳楚-h4e
@欧阳楚-h4e 5 жыл бұрын
fatal error: all goroutines are asleep - deadlock!
@remariorichards8237
@remariorichards8237 6 жыл бұрын
hi, why did you not close the error channel as well?
@niharrathod
@niharrathod 6 жыл бұрын
Same question. Any idea why?
@wangfenjin
@wangfenjin 6 жыл бұрын
Because if you don't close the error channel, the last return statement maybe blocked forever if there is no value in the chan. Receive from a closed chan will return immediately even if it's empty.
@niharrathod
@niharrathod 6 жыл бұрын
Thanks Fengin
@老撒-m7b
@老撒-m7b 5 жыл бұрын
i think it's OK if not close errchan
GopherCon 2017: Kavya Joshi - Understanding Channels
21:45
Gopher Academy
Рет қаралды 117 М.
Golang UK Conference 2016 - Dave Cheney - SOLID Go Design
27:30
GopherCon UK
Рет қаралды 109 М.
Happy birthday to you by Secret Vlog
00:12
Secret Vlog
Рет қаралды 6 МЛН
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 5 МЛН
Understanding Allocations: the Stack and the Heap - GopherCon SG 2019
21:39
Golang UK Conference 2017 | Arne Claus - Concurrency Patterns in Go
31:52
Twelve Go Best Practices - Francesc Campoy
49:27
Esri R&D Center
Рет қаралды 70 М.
GothamGo 2018 - Things in Go I Never Use by Mat Ryer
24:53
Nation Confrences
Рет қаралды 85 М.
Concurrency in Go
18:40
Jake Wright
Рет қаралды 621 М.
Writing Microservice Integration Tests in Go (Finally) - GopherCon SG 2019
19:55
Concurrency Is Not Parallelism
31:11
Marc Streeter
Рет қаралды 8 М.