Тёмный

Concurrency made easy - GopherCon SG 2017 

Singapore Gophers
Подписаться 5 тыс.
Просмотров 26 тыс.
50% 1

Speaker: Dave Cheney
Go’s headline feature is its simple, lightweight concurrency, but most Go programmers that stick with the language for a while tend to look back on their early efforts and say things like “wow, I really went overboard with channels” or “I went crazy with goroutines, it was impossible to understand what the program did”. Clearly there is a disconnect between the concurrency primitives that the language offers, and the expectations of many why come to Go for exactly those features. This talk will explore some strategies for using with concurrency in Go without the pitfalls.
Event Website: 2017.gophercon.sg
Produced by Engineers.SG

Наука

Опубликовано:

 

28 май 2017

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 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.
@FrenchPirate83
@FrenchPirate83 6 лет назад
Minor, but could sem not have been a chan struct{} instead of a chan int?
@able2663
@able2663 2 года назад
nice sharing.
@mikei4min
@mikei4min 7 лет назад
By the way Dave Cheney is a great author - dave.cheney.net/!
@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
@user-bu2xf9iq2v
@user-bu2xf9iq2v 4 года назад
fatal error: all goroutines are asleep - deadlock!
@user-ek2rg8ln1v
@user-ek2rg8ln1v 5 лет назад
i think it's OK if not close errchan
Далее
Угадай МОБА 1 🥵 | WICSUR #shorts
01:00
Просмотров 1,7 млн
Concurrency in Go
18:40
Просмотров 610 тыс.
Garbage Collection Semantics - GopherCon SG 2019
26:56
Twelve Go Best Practices - Francesc Campoy
49:27
Просмотров 70 тыс.
Going Secure with Go - GopherCon SG 2019
23:35
Просмотров 10 тыс.
GopherCon 2017: Kavya Joshi - Understanding Channels
21:45
Google I/O 2012 - Go Concurrency Patterns
51:27
Просмотров 802 тыс.
Samsung laughing on iPhone #techbyakram
0:12
Просмотров 4,1 млн