36
---------- 1 GO CONCURRENCY FOR BEGINNERS https://fb.com/me.adunhansa https://twitter.com/arahansa http://adunhansa.tistory.com/ 사이트 : http://arahansa.com ABOUT CONTACT SOURCE 1

Slipp 발표 - GO

  • Upload
    -

  • View
    6.088

  • Download
    2

Embed Size (px)

Citation preview

---------- 1

GO CONCURRENCY FOR BEGINNERS

https://fb.com/me.adunhansahttps://twitter.com/arahansahttp://adunhansa.tistory.com/

사이트 : http://arahansa.com

AB

OU

T

CO

NTA

CT

SOU

RC

E

1

1. 작성자 소개 2 -----------------------

-------------------------------------------- 평소 정리를 즐겨합니다. 한 때 동영상강좌도

만들다보니.. 비실명과 만화캐릭터를 쓰네요

양해 부탁드립니다 ㅎㅎ

목차 3

1. Go 역사

2. GO 특징 - 시스템 프로그래밍 동시성

웹개발자로써, 바라보는 Go 4

2014년 말...

CRUD CRUD CRUD

GO! Channel~

Pointer variable

Go 좀 공부해볼까?! 5

Hello World ! Go !

1. Go의 역사 6

2007

1. Go의 역사 7

2009

2. Go의 특징 - 시스템 프로그래밍 8

HardWare

O S

User

App

System Programming

Application Programming

2. Go의 특징 - 시스템 프로그래밍 9

HardWare

O S

User

App

System Programming

Application Programming

2. Go의 특징 - 시스템 프로그래밍 10

빠른 컴파일, 높은 동시성 지원, 저수준의 interface지원 정적타입, 덕타이핑, multi arch build

2. Go의 특징 - 동시성 11

built in

4KB~8kb

Multiplexed

a kind of thread

2. Go의 특징 - 동시성 12

잠시.. GO에서의 동시성과 관련된 이야기를 조금 세부적으로 해보겠습니다^.^

2. Go의 특징 - 동시성 - Go 13

GO 함수명()

Keyworkd: GO루틴

2. Go의 특징 - 동시성 - Go 14

main function

안녕 세계!

안녕 GO

1 second

CHANNEL!

2. Go의 특징 - 동시성 - Go 15

변수명 := make(채널 타입)

Keyworkd: 채널

Go! Stop!

CHANNEL!

2. Go의 특징 - 동시성 - 채널 16

main function

안녕 세계!

End!

2. Go의 특징 - 동시성 - 채널 17

pong ping

2. Go의 특징 - 동시성 - 채널 18

운동했더니 힘들군..

회나 먹으러 GO할까?

2. Go의 특징 - 동시성 - 채널 19

GO 초밥집

CHANNEL!

회 ?

2. Go의 특징 - 동시성 - 채널 20

2. Go의 특징 - 동시성 - 채널 21

• 다른 언어 방식

출처 : 하룻밤에 읽는 Go 언어 이야기 - 싞제용님

Shared Memory

Thread - A Thread - B

• GO 채널 방식

출처 : 하룻밤에 읽는 Go 언어 이야기 - 싞제용님

채널

2. Go의 특징 - 동시성 - 채널 22

GO 루틴 GO 루틴

• GO 채널 방식

• 출처 : 하룻밤에 읽는 Go 언어 이야기 - 싞제용님

동기화 데이터 =>

2. Go의 특징 - 동시성 - 채널 23

GO 루틴 GO 루틴

CH

CH

2. Go의 특징 - 동시성 - select 24

select{

case msg := <-ch1 :

case msg2 := <-ch2 :

}

Keyworkd: 셀렉트

Go!

Go!

select

CH Go!

2. Go의 특징 - 동시성 - select 25

CH

Go!

select

CH Go!

2. Go의 특징 - 동시성 - DeadLock 26

2. Go의 특징 - 동시성 - DeadLock 27

• 채널로 메시지 수싞 대기를 하고 있지만 메시지를 보내지 않는 Go루틴...

CHANNEL!

2. Go의 특징 - 동시성 - Data race 28

Go!

Go!

Go!

2. Go의 특징 - 동시성 - Data race 29

-race 로 감지!

Keyworkd: -race

2. Go의 특징 - 동시성 - race Detector 30

2. Go의 특징 - 동시성 - Example 31

실제로 어떻게 쓰이냐구요..?

2. Go의 특징 - 동시성 - Example 32

참고 문헌 34

• 하룻밤에 읽는 Go 언어 이야기 – 싞제용님 http://hanbit.co.kr/ebook/look.html?isbn=9788968487903

• GO 동시성 http://www.nada.kth.se/~snilsson/concurrency/

• Rop Pike Slide : https://talks.golang.org/2012/concurrency.slide#1

• Sammer Ajmani : https://talks.golang.org/2013/advconc.slide#1

이미지 출처 35

• Gonuts with computer = http://kirael-art.deviantart.com/art/Go-lang-Mascot-458285682

• pingpong table ; http://www.osundefender.org/ijesa-youths-compete-in-1st-aregbesola-table-tennis-tourney/

• conveyor belt : http://www.flaticon.com/free-icon/box-on-band-conveyor-logistics-outline_59355 -- Designed by Freepik

• sushi : http://www.freepik.com/free-vector/sushi-illustrations-pack_761463.htm -- Designed by Freepik

• lcok : http://www.freepik.com/free-vector/colorful-round-business-icons_745371.htm">Designed by Freepik</a>

• thread - http://www.flaticon.com • skull - http://www.flaticon.com • gopher wrench - talks.golang.org

36

THANK YOU ! 즐거운 개발됩시다

arahansa ------

------

페북 : https://fb.com/me.adunhansa 트위터 : https://twitter.com/arahansa 블로그: http://adunhansa.tistory.com/ 사이트 : http://arahansa.com