SlideShare a Scribd company logo
1 of 39
동기의 시대를 뛰어넘는
응용 프로그램이
나쁜 평가를 받는 이유
사용자들은 대체적으로
성능과 연관 지어
응용 프로그램의
품질을 평가
개념
다른 측(다른 스레드/디바이스 드라이버)이 작업 수행
작업을 요청한 스레드와 작업을 수행하는 측이 동일하지 않다
비동기 함수 호출
작업요청 방식이 다르다
작업이 완료될 때까지 대기하지 않겠다
작업 완료 통지
작업이 완료되면 알려다오
작업 요청 스레드 작업 수행 스레드 혹은 Device Driver
작업 요청 스레드 작업 수행 스레드 혹은 Device Driver
작업 요청 스레드 작업 수행 스레드 혹은 Device Driver
작업 요청 스레드 작업 수행 스레드 혹은 Device Driver
비동기 프로그래밍
사용자의 조작에 빠르게 응답
CPU 작업을 효율적으로 수행
I/O 작업을 효율적으로 수행
public class MyClass
{
public int Read(byte [] buffer, int offset, int count);
}
public class MyClass
{
public IAsyncResult BeginRead(
byte [] buffer, int offset, int count,
AsyncCallback callback, object state);
public int EndRead(IAsyncResult asyncResult);
}
public class MyClass
{
public void ReadAsync(byte [] buffer, int offset, int count);
public event ReadCompletedEventHandler ReadCompleted;
}
public class MyClass
{
public Task<int> ReadAsync(byte [] buffer, int offset, int count);
}
1. Sync
2. APM
3. EAP
4. TAP
private void Button_Click(object sender, RoutedEventArgs e)
{
string url = "http://windowsteamblog.com/windows/b/windowsexperience/atom.aspx";
WebClient client = new WebClient();
client.DownloadStringCompleted += client_DownloadStringCompleted;
client.DownloadStringAsync(new Uri(url)); // 수행해야할 작업을 전달
// 다른 일을 할 수도 있다
}
// 작업이 완료되면 이벤트를 발생시켜 통보
void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs arg)
{
Debug.WriteLine(arg.Result);
}
private void Button_Click(object sender, RoutedEventArgs e)
{
string url = "http://windowsteamblog.com/windows/b/windowsexperience/atom.aspx";
WebClient client = new WebClient();
client.DownloadStringCompleted += (s, arg) => Debug.WriteLine(arg.Result);
client.DownloadStringAsync(new Uri(url));
}
private void Button_Click(object sender, RoutedEventArgs e)
{
Task.Run(() => WorkAsync());
}
private void WorkAsync()
{
string url = "http://windowsteamblog.com/windows/b/windowsexperience/atom.aspx";
WebClient client = new WebClient();
Task<string> t = client.DownloadStringTaskAsync(new Uri(url));
t.Wait(); // 작업이 완료되때까지 대기
Debug.WriteLine(t.Result);
}
private void Button_Click(object sender, RoutedEventArgs e)
{
Task.Run(() => WorkAsync());
}
private void WorkAsync()
{
string url = "http://windowsteamblog.com/windows/b/windowsexperience/atom.aspx";
WebClient client = new WebClient();
Task<string> t = client.DownloadStringTaskAsync(new Uri(url));
t.ContinueWith((prevTask) => Debug.WriteLine(prevTask.Result));
}
async Task<int> FuncAsync()
{
int r = await DoAsync();
return r;
}
• TAP과 함께
• APM/EAPTAP로 변환
• 비동기 함수의 이름은
XxxAsync()/XxxTaskAsync()
• await 와 async는 함께
• 반환형은
Task, Task<TResult>
private async void Button_Click(object sender, RoutedEventArgs e)
{
await WorkAsync();
}
private async Task WorkAsync()
{
string url = "http://windowsteamblog.com/windows/b/windowsexperience/atom.aspx";
WebClient client = new WebClient();
string result = await client.DownloadStringTaskAsync(new Uri(url));
Debug.WriteLine(result);
}
Click
async Task LoadSettingsAsync() {
await IO.Network.DownloadAsync(path);
}
async void Button1_Click(){
await LoadSettingsAsync();
UpdateView();
}
Click
Messagepump
Task ...
DownloadAsync
Task ...
LoadSettingsAsync
Download
LoadSettings
private void Button_Click(object sender, RoutedEventArgs e)
{
string url = "http://windowsteamblog.com/windows/b/windowsexperience/atom.aspx";
WebClient client = new WebClient();
Task<string> t = client.DownloadStringTaskAsync(new Uri(url));
t.ContinueWith((r) => Debug.WriteLine(r.Result));
}
private async void Button_Click_1(object sender, RoutedEventArgs e)
{
string url = "http://windowsteamblog.com/windows/b/windowsexperience/atom.aspx";
WebClient client = new WebClient();
string result = await client.DownloadStringTaskAsync(new Uri(url));
Debug.WriteLine(result);
}
TAP with async/await
TAP
TAP
EAP
TAP, ContinueWith
async/await
WinRT의 비동기
C++는 PPL
C#, VB는 TPL과 async/await
Javascript는 commonJS/A 의 promise/then
+ +
Windows Runtime
public sealed class SyndicationClient : ISyndicationClient
{
public IAsyncOperationWithProgress<SyndicationFeed, RetrievalProgress>
RetrieveFeedAsync(Uri uri);
…
}
public sealed class SyndicationFeed : ISyndicationNode
{
public ISyndicationText Title { get; set; }
…
}
public interface ISyndicationText : ISyndicationNode
{
string Text { get; set; }
…
}
#include <ppltasks.h>
void App::SetFeedText() {
using namespace Windows::Web::Syndication;
using namespace concurrency;
String^ url = "http://windowsteamblog.com/windows_phone/b/wmdev/atom.aspx";
SyndicationClient^ client = ref new SyndicationClient();
task<SyndicationFeed^> retriveTask(client->RetrieveFeedAsync(ref new Uri(url)));
retriveTask.then([this] (SyndicationFeed^ feed)
{
String ^title = feed->Title->Text;
});
}
function SetFeedText()
{
var url = "http://windowsteamblog.com/windows/b/windowsexperience/atom.aspx";
var client = Windows.Web.Syndication.SyndicationClient();
var feedOp = client.retrieveFeedAsync(new Windows.Foundation.Uri(url));
feedOp.then(function (feed)
{
var title = feed.title.text;
});
}
private async void SetFeedText()
{
string url = "http://windowsteamblog.com/windows/b/windowsexperience/atom.aspx";
SyndicationClient client = new SyndicationClient();
SyndicationFeed feed = await client.RetrieveFeedAsync(new Uri(url));
var title = feed.Title.Text;
}
async/await
Use raw interface
Multiple task
Task Combination
비동기 프로그래밍 원리와 WinRT의 비동기 모델
비동기 프로그래밍 원리와 WinRT의 비동기 모델

More Related Content

What's hot

게임 분산 서버 구조
게임 분산 서버 구조게임 분산 서버 구조
게임 분산 서버 구조Hyunjik Bae
 
〈야생의 땅: 듀랑고〉 서버 아키텍처 Vol. 3
〈야생의 땅: 듀랑고〉 서버 아키텍처 Vol. 3〈야생의 땅: 듀랑고〉 서버 아키텍처 Vol. 3
〈야생의 땅: 듀랑고〉 서버 아키텍처 Vol. 3Heungsub Lee
 
조정훈, 게임 프로그래머를 위한 클래스 설계, NDC2012
조정훈, 게임 프로그래머를 위한 클래스 설계, NDC2012조정훈, 게임 프로그래머를 위한 클래스 설계, NDC2012
조정훈, 게임 프로그래머를 위한 클래스 설계, NDC2012devCAT Studio, NEXON
 
ASP.NET과 C#으로 개발하는 대규모 소셜 게임
ASP.NET과 C#으로 개발하는 대규모 소셜 게임ASP.NET과 C#으로 개발하는 대규모 소셜 게임
ASP.NET과 C#으로 개발하는 대규모 소셜 게임흥배 최
 
이승재, 실버바인 서버엔진 2 설계 리뷰, NDC2018
이승재, 실버바인 서버엔진 2 설계 리뷰, NDC2018이승재, 실버바인 서버엔진 2 설계 리뷰, NDC2018
이승재, 실버바인 서버엔진 2 설계 리뷰, NDC2018devCAT Studio, NEXON
 
[야생의 땅: 듀랑고] 서버 아키텍처 - SPOF 없는 분산 MMORPG 서버
[야생의 땅: 듀랑고] 서버 아키텍처 - SPOF 없는 분산 MMORPG 서버[야생의 땅: 듀랑고] 서버 아키텍처 - SPOF 없는 분산 MMORPG 서버
[야생의 땅: 듀랑고] 서버 아키텍처 - SPOF 없는 분산 MMORPG 서버Heungsub Lee
 
[2019] 200만 동접 게임을 위한 MySQL 샤딩
[2019] 200만 동접 게임을 위한 MySQL 샤딩[2019] 200만 동접 게임을 위한 MySQL 샤딩
[2019] 200만 동접 게임을 위한 MySQL 샤딩NHN FORWARD
 
테라로 살펴본 MMORPG의 논타겟팅 시스템
테라로 살펴본 MMORPG의 논타겟팅 시스템테라로 살펴본 MMORPG의 논타겟팅 시스템
테라로 살펴본 MMORPG의 논타겟팅 시스템QooJuice
 
[IGC 2017] 아마존 구승모 - 게임 엔진으로 서버 제작 및 운영까지
[IGC 2017] 아마존 구승모 - 게임 엔진으로 서버 제작 및 운영까지[IGC 2017] 아마존 구승모 - 게임 엔진으로 서버 제작 및 운영까지
[IGC 2017] 아마존 구승모 - 게임 엔진으로 서버 제작 및 운영까지강 민우
 
Ndc14 분산 서버 구축의 ABC
Ndc14 분산 서버 구축의 ABCNdc14 분산 서버 구축의 ABC
Ndc14 분산 서버 구축의 ABCHo Gyu Lee
 
실시간 게임 서버 최적화 전략
실시간 게임 서버 최적화 전략실시간 게임 서버 최적화 전략
실시간 게임 서버 최적화 전략YEONG-CHEON YOU
 
양승명, 다음 세대 크로스플랫폼 MMORPG 아키텍처, NDC2012
양승명, 다음 세대 크로스플랫폼 MMORPG 아키텍처, NDC2012양승명, 다음 세대 크로스플랫폼 MMORPG 아키텍처, NDC2012
양승명, 다음 세대 크로스플랫폼 MMORPG 아키텍처, NDC2012devCAT Studio, NEXON
 
이무림, Enum의 Boxing을 어찌할꼬? 편리하고 성능좋게 Enum 사용하기, NDC2019
이무림, Enum의 Boxing을 어찌할꼬? 편리하고 성능좋게 Enum 사용하기, NDC2019이무림, Enum의 Boxing을 어찌할꼬? 편리하고 성능좋게 Enum 사용하기, NDC2019
이무림, Enum의 Boxing을 어찌할꼬? 편리하고 성능좋게 Enum 사용하기, NDC2019devCAT Studio, NEXON
 
NDC 2017 하재승 NEXON ZERO (넥슨 제로) 점검없이 실시간으로 코드 수정 및 게임 정보 수집하기
NDC 2017 하재승 NEXON ZERO (넥슨 제로) 점검없이 실시간으로 코드 수정 및 게임 정보 수집하기NDC 2017 하재승 NEXON ZERO (넥슨 제로) 점검없이 실시간으로 코드 수정 및 게임 정보 수집하기
NDC 2017 하재승 NEXON ZERO (넥슨 제로) 점검없이 실시간으로 코드 수정 및 게임 정보 수집하기Jaeseung Ha
 
언리얼4 플레이어 컨트롤러의 이해.
언리얼4 플레이어 컨트롤러의 이해.언리얼4 플레이어 컨트롤러의 이해.
언리얼4 플레이어 컨트롤러의 이해.Wuwon Yu
 
Azure로 MMO게임 서비스하기
Azure로 MMO게임 서비스하기Azure로 MMO게임 서비스하기
Azure로 MMO게임 서비스하기YEONG-CHEON YOU
 
Next-generation MMORPG service architecture
Next-generation MMORPG service architectureNext-generation MMORPG service architecture
Next-generation MMORPG service architectureJongwon Kim
 
Windows Registered I/O (RIO) vs IOCP
Windows Registered I/O (RIO) vs IOCPWindows Registered I/O (RIO) vs IOCP
Windows Registered I/O (RIO) vs IOCPSeungmo Koo
 
NoSQL 위에서 MMORPG 개발하기
NoSQL 위에서 MMORPG 개발하기NoSQL 위에서 MMORPG 개발하기
NoSQL 위에서 MMORPG 개발하기Hoyoung Choi
 
Data-Oriented Design과 유니티 DOTS
Data-Oriented Design과 유니티 DOTSData-Oriented Design과 유니티 DOTS
Data-Oriented Design과 유니티 DOTSSukwoo Lee
 

What's hot (20)

게임 분산 서버 구조
게임 분산 서버 구조게임 분산 서버 구조
게임 분산 서버 구조
 
〈야생의 땅: 듀랑고〉 서버 아키텍처 Vol. 3
〈야생의 땅: 듀랑고〉 서버 아키텍처 Vol. 3〈야생의 땅: 듀랑고〉 서버 아키텍처 Vol. 3
〈야생의 땅: 듀랑고〉 서버 아키텍처 Vol. 3
 
조정훈, 게임 프로그래머를 위한 클래스 설계, NDC2012
조정훈, 게임 프로그래머를 위한 클래스 설계, NDC2012조정훈, 게임 프로그래머를 위한 클래스 설계, NDC2012
조정훈, 게임 프로그래머를 위한 클래스 설계, NDC2012
 
ASP.NET과 C#으로 개발하는 대규모 소셜 게임
ASP.NET과 C#으로 개발하는 대규모 소셜 게임ASP.NET과 C#으로 개발하는 대규모 소셜 게임
ASP.NET과 C#으로 개발하는 대규모 소셜 게임
 
이승재, 실버바인 서버엔진 2 설계 리뷰, NDC2018
이승재, 실버바인 서버엔진 2 설계 리뷰, NDC2018이승재, 실버바인 서버엔진 2 설계 리뷰, NDC2018
이승재, 실버바인 서버엔진 2 설계 리뷰, NDC2018
 
[야생의 땅: 듀랑고] 서버 아키텍처 - SPOF 없는 분산 MMORPG 서버
[야생의 땅: 듀랑고] 서버 아키텍처 - SPOF 없는 분산 MMORPG 서버[야생의 땅: 듀랑고] 서버 아키텍처 - SPOF 없는 분산 MMORPG 서버
[야생의 땅: 듀랑고] 서버 아키텍처 - SPOF 없는 분산 MMORPG 서버
 
[2019] 200만 동접 게임을 위한 MySQL 샤딩
[2019] 200만 동접 게임을 위한 MySQL 샤딩[2019] 200만 동접 게임을 위한 MySQL 샤딩
[2019] 200만 동접 게임을 위한 MySQL 샤딩
 
테라로 살펴본 MMORPG의 논타겟팅 시스템
테라로 살펴본 MMORPG의 논타겟팅 시스템테라로 살펴본 MMORPG의 논타겟팅 시스템
테라로 살펴본 MMORPG의 논타겟팅 시스템
 
[IGC 2017] 아마존 구승모 - 게임 엔진으로 서버 제작 및 운영까지
[IGC 2017] 아마존 구승모 - 게임 엔진으로 서버 제작 및 운영까지[IGC 2017] 아마존 구승모 - 게임 엔진으로 서버 제작 및 운영까지
[IGC 2017] 아마존 구승모 - 게임 엔진으로 서버 제작 및 운영까지
 
Ndc14 분산 서버 구축의 ABC
Ndc14 분산 서버 구축의 ABCNdc14 분산 서버 구축의 ABC
Ndc14 분산 서버 구축의 ABC
 
실시간 게임 서버 최적화 전략
실시간 게임 서버 최적화 전략실시간 게임 서버 최적화 전략
실시간 게임 서버 최적화 전략
 
양승명, 다음 세대 크로스플랫폼 MMORPG 아키텍처, NDC2012
양승명, 다음 세대 크로스플랫폼 MMORPG 아키텍처, NDC2012양승명, 다음 세대 크로스플랫폼 MMORPG 아키텍처, NDC2012
양승명, 다음 세대 크로스플랫폼 MMORPG 아키텍처, NDC2012
 
이무림, Enum의 Boxing을 어찌할꼬? 편리하고 성능좋게 Enum 사용하기, NDC2019
이무림, Enum의 Boxing을 어찌할꼬? 편리하고 성능좋게 Enum 사용하기, NDC2019이무림, Enum의 Boxing을 어찌할꼬? 편리하고 성능좋게 Enum 사용하기, NDC2019
이무림, Enum의 Boxing을 어찌할꼬? 편리하고 성능좋게 Enum 사용하기, NDC2019
 
NDC 2017 하재승 NEXON ZERO (넥슨 제로) 점검없이 실시간으로 코드 수정 및 게임 정보 수집하기
NDC 2017 하재승 NEXON ZERO (넥슨 제로) 점검없이 실시간으로 코드 수정 및 게임 정보 수집하기NDC 2017 하재승 NEXON ZERO (넥슨 제로) 점검없이 실시간으로 코드 수정 및 게임 정보 수집하기
NDC 2017 하재승 NEXON ZERO (넥슨 제로) 점검없이 실시간으로 코드 수정 및 게임 정보 수집하기
 
언리얼4 플레이어 컨트롤러의 이해.
언리얼4 플레이어 컨트롤러의 이해.언리얼4 플레이어 컨트롤러의 이해.
언리얼4 플레이어 컨트롤러의 이해.
 
Azure로 MMO게임 서비스하기
Azure로 MMO게임 서비스하기Azure로 MMO게임 서비스하기
Azure로 MMO게임 서비스하기
 
Next-generation MMORPG service architecture
Next-generation MMORPG service architectureNext-generation MMORPG service architecture
Next-generation MMORPG service architecture
 
Windows Registered I/O (RIO) vs IOCP
Windows Registered I/O (RIO) vs IOCPWindows Registered I/O (RIO) vs IOCP
Windows Registered I/O (RIO) vs IOCP
 
NoSQL 위에서 MMORPG 개발하기
NoSQL 위에서 MMORPG 개발하기NoSQL 위에서 MMORPG 개발하기
NoSQL 위에서 MMORPG 개발하기
 
Data-Oriented Design과 유니티 DOTS
Data-Oriented Design과 유니티 DOTSData-Oriented Design과 유니티 DOTS
Data-Oriented Design과 유니티 DOTS
 

Similar to 비동기 프로그래밍 원리와 WinRT의 비동기 모델

Unit Testing Express and Koa Middleware in ES2015
Unit Testing Express and Koa Middleware in ES2015Unit Testing Express and Koa Middleware in ES2015
Unit Testing Express and Koa Middleware in ES2015Morris Singer
 
Async programming on NET
Async programming on NETAsync programming on NET
Async programming on NETyuyijq
 
Asynchronous programming in .net 4.5 with c#
Asynchronous programming in .net 4.5 with c#Asynchronous programming in .net 4.5 with c#
Asynchronous programming in .net 4.5 with c#Binu Bhasuran
 
Asynchronous in dot net4
Asynchronous in dot net4Asynchronous in dot net4
Asynchronous in dot net4Wei Sun
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSam Brannen
 
Building Web Apps with Express
Building Web Apps with ExpressBuilding Web Apps with Express
Building Web Apps with ExpressAaron Stannard
 
Azure Durable Functions (2019-03-30)
Azure Durable Functions (2019-03-30) Azure Durable Functions (2019-03-30)
Azure Durable Functions (2019-03-30) Paco de la Cruz
 
Reactive programming every day
Reactive programming every dayReactive programming every day
Reactive programming every dayVadym Khondar
 
Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)Paco de la Cruz
 
Workshop 4: NodeJS. Express Framework & MongoDB.
Workshop 4: NodeJS. Express Framework & MongoDB.Workshop 4: NodeJS. Express Framework & MongoDB.
Workshop 4: NodeJS. Express Framework & MongoDB.Visual Engineering
 
Durable functions 2.0 (2019-10-10)
Durable functions 2.0 (2019-10-10)Durable functions 2.0 (2019-10-10)
Durable functions 2.0 (2019-10-10)Paco de la Cruz
 
Server side JavaScript: going all the way
Server side JavaScript: going all the wayServer side JavaScript: going all the way
Server side JavaScript: going all the wayOleg Podsechin
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasyJBug Italy
 

Similar to 비동기 프로그래밍 원리와 WinRT의 비동기 모델 (20)

Middleware.pdf
Middleware.pdfMiddleware.pdf
Middleware.pdf
 
Unit Testing Express and Koa Middleware in ES2015
Unit Testing Express and Koa Middleware in ES2015Unit Testing Express and Koa Middleware in ES2015
Unit Testing Express and Koa Middleware in ES2015
 
Async programming on NET
Async programming on NETAsync programming on NET
Async programming on NET
 
Asynchronous programming in .net 4.5 with c#
Asynchronous programming in .net 4.5 with c#Asynchronous programming in .net 4.5 with c#
Asynchronous programming in .net 4.5 with c#
 
Asynchronous in dot net4
Asynchronous in dot net4Asynchronous in dot net4
Asynchronous in dot net4
 
Spring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. RESTSpring Web Services: SOAP vs. REST
Spring Web Services: SOAP vs. REST
 
JS everywhere 2011
JS everywhere 2011JS everywhere 2011
JS everywhere 2011
 
Android best practices
Android best practicesAndroid best practices
Android best practices
 
Building Web Apps with Express
Building Web Apps with ExpressBuilding Web Apps with Express
Building Web Apps with Express
 
Azure Durable Functions (2019-03-30)
Azure Durable Functions (2019-03-30) Azure Durable Functions (2019-03-30)
Azure Durable Functions (2019-03-30)
 
Intro to Node
Intro to NodeIntro to Node
Intro to Node
 
Reactive programming every day
Reactive programming every dayReactive programming every day
Reactive programming every day
 
Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)
 
Workshop 4: NodeJS. Express Framework & MongoDB.
Workshop 4: NodeJS. Express Framework & MongoDB.Workshop 4: NodeJS. Express Framework & MongoDB.
Workshop 4: NodeJS. Express Framework & MongoDB.
 
Welcome to an asynchronous world 1.29s
Welcome to an asynchronous world 1.29sWelcome to an asynchronous world 1.29s
Welcome to an asynchronous world 1.29s
 
Serverless Java on Kubernetes
Serverless Java on KubernetesServerless Java on Kubernetes
Serverless Java on Kubernetes
 
Durable functions 2.0 (2019-10-10)
Durable functions 2.0 (2019-10-10)Durable functions 2.0 (2019-10-10)
Durable functions 2.0 (2019-10-10)
 
Server side JavaScript: going all the way
Server side JavaScript: going all the wayServer side JavaScript: going all the way
Server side JavaScript: going all the way
 
May 2010 - RestEasy
May 2010 - RestEasyMay 2010 - RestEasy
May 2010 - RestEasy
 
RESTEasy
RESTEasyRESTEasy
RESTEasy
 

More from 명신 김

업무를 빼고 가치를 더하는 클라우드 기술
업무를 빼고 가치를 더하는 클라우드 기술업무를 빼고 가치를 더하는 클라우드 기술
업무를 빼고 가치를 더하는 클라우드 기술명신 김
 
[2020 Ignite Seoul]Azure에서 사용할 수 있는 컨테이너/오케스트레이션 기술 살펴보기
[2020 Ignite Seoul]Azure에서 사용할 수 있는 컨테이너/오케스트레이션 기술 살펴보기[2020 Ignite Seoul]Azure에서 사용할 수 있는 컨테이너/오케스트레이션 기술 살펴보기
[2020 Ignite Seoul]Azure에서 사용할 수 있는 컨테이너/오케스트레이션 기술 살펴보기명신 김
 
Best of Build Seoul 2019 Keynote
Best of Build Seoul 2019 KeynoteBest of Build Seoul 2019 Keynote
Best of Build Seoul 2019 Keynote명신 김
 
Passwordless society
Passwordless societyPasswordless society
Passwordless society명신 김
 
DevOps and Azure Devops 소개, 동향, 그리고 기대효과
DevOps and Azure Devops 소개, 동향, 그리고 기대효과DevOps and Azure Devops 소개, 동향, 그리고 기대효과
DevOps and Azure Devops 소개, 동향, 그리고 기대효과명신 김
 
Serverless design and adoption
Serverless design and adoptionServerless design and adoption
Serverless design and adoption명신 김
 
Durable functions
Durable functionsDurable functions
Durable functions명신 김
 
Azure functions v2 announcement
Azure functions v2 announcementAzure functions v2 announcement
Azure functions v2 announcement명신 김
 
Azure functions
Azure functionsAzure functions
Azure functions명신 김
 
Azure event grid
Azure event gridAzure event grid
Azure event grid명신 김
 
Serverless, Azure Functions, Logic Apps
Serverless, Azure Functions, Logic AppsServerless, Azure Functions, Logic Apps
Serverless, Azure Functions, Logic Apps명신 김
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture명신 김
 
Visual studio 2015를 활용한 개발 생산성 및 코드 품질 혁신
Visual studio 2015를 활용한 개발 생산성 및 코드 품질 혁신Visual studio 2015를 활용한 개발 생산성 및 코드 품질 혁신
Visual studio 2015를 활용한 개발 생산성 및 코드 품질 혁신명신 김
 
Connect(); 2016 한시간 총정리
Connect(); 2016 한시간 총정리Connect(); 2016 한시간 총정리
Connect(); 2016 한시간 총정리명신 김
 
크로스 플랫폼을 품은 오픈 소스 프레임워크 .NET Core
크로스 플랫폼을 품은 오픈 소스 프레임워크 .NET Core크로스 플랫폼을 품은 오픈 소스 프레임워크 .NET Core
크로스 플랫폼을 품은 오픈 소스 프레임워크 .NET Core명신 김
 
Coded UI test를 이용한 테스트 자동화
Coded UI test를 이용한 테스트 자동화Coded UI test를 이용한 테스트 자동화
Coded UI test를 이용한 테스트 자동화명신 김
 
VS2015 C++ new features
VS2015 C++ new featuresVS2015 C++ new features
VS2015 C++ new features명신 김
 
Welcome to the microsoft madness
Welcome to the microsoft madnessWelcome to the microsoft madness
Welcome to the microsoft madness명신 김
 

More from 명신 김 (20)

업무를 빼고 가치를 더하는 클라우드 기술
업무를 빼고 가치를 더하는 클라우드 기술업무를 빼고 가치를 더하는 클라우드 기술
업무를 빼고 가치를 더하는 클라우드 기술
 
[2020 Ignite Seoul]Azure에서 사용할 수 있는 컨테이너/오케스트레이션 기술 살펴보기
[2020 Ignite Seoul]Azure에서 사용할 수 있는 컨테이너/오케스트레이션 기술 살펴보기[2020 Ignite Seoul]Azure에서 사용할 수 있는 컨테이너/오케스트레이션 기술 살펴보기
[2020 Ignite Seoul]Azure에서 사용할 수 있는 컨테이너/오케스트레이션 기술 살펴보기
 
Best of Build Seoul 2019 Keynote
Best of Build Seoul 2019 KeynoteBest of Build Seoul 2019 Keynote
Best of Build Seoul 2019 Keynote
 
Passwordless society
Passwordless societyPasswordless society
Passwordless society
 
DevOps and Azure Devops 소개, 동향, 그리고 기대효과
DevOps and Azure Devops 소개, 동향, 그리고 기대효과DevOps and Azure Devops 소개, 동향, 그리고 기대효과
DevOps and Azure Devops 소개, 동향, 그리고 기대효과
 
Serverless design and adoption
Serverless design and adoptionServerless design and adoption
Serverless design and adoption
 
Durable functions
Durable functionsDurable functions
Durable functions
 
Azure functions v2 announcement
Azure functions v2 announcementAzure functions v2 announcement
Azure functions v2 announcement
 
Azure functions
Azure functionsAzure functions
Azure functions
 
Logic apps
Logic appsLogic apps
Logic apps
 
Serverless
ServerlessServerless
Serverless
 
Azure event grid
Azure event gridAzure event grid
Azure event grid
 
Serverless, Azure Functions, Logic Apps
Serverless, Azure Functions, Logic AppsServerless, Azure Functions, Logic Apps
Serverless, Azure Functions, Logic Apps
 
Microservices architecture
Microservices architectureMicroservices architecture
Microservices architecture
 
Visual studio 2015를 활용한 개발 생산성 및 코드 품질 혁신
Visual studio 2015를 활용한 개발 생산성 및 코드 품질 혁신Visual studio 2015를 활용한 개발 생산성 및 코드 품질 혁신
Visual studio 2015를 활용한 개발 생산성 및 코드 품질 혁신
 
Connect(); 2016 한시간 총정리
Connect(); 2016 한시간 총정리Connect(); 2016 한시간 총정리
Connect(); 2016 한시간 총정리
 
크로스 플랫폼을 품은 오픈 소스 프레임워크 .NET Core
크로스 플랫폼을 품은 오픈 소스 프레임워크 .NET Core크로스 플랫폼을 품은 오픈 소스 프레임워크 .NET Core
크로스 플랫폼을 품은 오픈 소스 프레임워크 .NET Core
 
Coded UI test를 이용한 테스트 자동화
Coded UI test를 이용한 테스트 자동화Coded UI test를 이용한 테스트 자동화
Coded UI test를 이용한 테스트 자동화
 
VS2015 C++ new features
VS2015 C++ new featuresVS2015 C++ new features
VS2015 C++ new features
 
Welcome to the microsoft madness
Welcome to the microsoft madnessWelcome to the microsoft madness
Welcome to the microsoft madness
 

Recently uploaded

Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio, Inc.
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackVICTOR MAESTRE RAMIREZ
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 

Recently uploaded (20)

Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed DataAlluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
Alluxio Monthly Webinar | Cloud-Native Model Training on Distributed Data
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Cloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStackCloud Management Software Platforms: OpenStack
Cloud Management Software Platforms: OpenStack
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 

비동기 프로그래밍 원리와 WinRT의 비동기 모델

  • 2.
  • 3. 응용 프로그램이 나쁜 평가를 받는 이유 사용자들은 대체적으로 성능과 연관 지어 응용 프로그램의 품질을 평가
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11. 개념 다른 측(다른 스레드/디바이스 드라이버)이 작업 수행 작업을 요청한 스레드와 작업을 수행하는 측이 동일하지 않다 비동기 함수 호출 작업요청 방식이 다르다 작업이 완료될 때까지 대기하지 않겠다 작업 완료 통지 작업이 완료되면 알려다오
  • 12. 작업 요청 스레드 작업 수행 스레드 혹은 Device Driver
  • 13. 작업 요청 스레드 작업 수행 스레드 혹은 Device Driver
  • 14. 작업 요청 스레드 작업 수행 스레드 혹은 Device Driver
  • 15. 작업 요청 스레드 작업 수행 스레드 혹은 Device Driver
  • 16. 비동기 프로그래밍 사용자의 조작에 빠르게 응답 CPU 작업을 효율적으로 수행 I/O 작업을 효율적으로 수행
  • 17.
  • 18.
  • 19.
  • 20. public class MyClass { public int Read(byte [] buffer, int offset, int count); } public class MyClass { public IAsyncResult BeginRead( byte [] buffer, int offset, int count, AsyncCallback callback, object state); public int EndRead(IAsyncResult asyncResult); } public class MyClass { public void ReadAsync(byte [] buffer, int offset, int count); public event ReadCompletedEventHandler ReadCompleted; } public class MyClass { public Task<int> ReadAsync(byte [] buffer, int offset, int count); } 1. Sync 2. APM 3. EAP 4. TAP
  • 21. private void Button_Click(object sender, RoutedEventArgs e) { string url = "http://windowsteamblog.com/windows/b/windowsexperience/atom.aspx"; WebClient client = new WebClient(); client.DownloadStringCompleted += client_DownloadStringCompleted; client.DownloadStringAsync(new Uri(url)); // 수행해야할 작업을 전달 // 다른 일을 할 수도 있다 } // 작업이 완료되면 이벤트를 발생시켜 통보 void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs arg) { Debug.WriteLine(arg.Result); }
  • 22. private void Button_Click(object sender, RoutedEventArgs e) { string url = "http://windowsteamblog.com/windows/b/windowsexperience/atom.aspx"; WebClient client = new WebClient(); client.DownloadStringCompleted += (s, arg) => Debug.WriteLine(arg.Result); client.DownloadStringAsync(new Uri(url)); }
  • 23. private void Button_Click(object sender, RoutedEventArgs e) { Task.Run(() => WorkAsync()); } private void WorkAsync() { string url = "http://windowsteamblog.com/windows/b/windowsexperience/atom.aspx"; WebClient client = new WebClient(); Task<string> t = client.DownloadStringTaskAsync(new Uri(url)); t.Wait(); // 작업이 완료되때까지 대기 Debug.WriteLine(t.Result); }
  • 24. private void Button_Click(object sender, RoutedEventArgs e) { Task.Run(() => WorkAsync()); } private void WorkAsync() { string url = "http://windowsteamblog.com/windows/b/windowsexperience/atom.aspx"; WebClient client = new WebClient(); Task<string> t = client.DownloadStringTaskAsync(new Uri(url)); t.ContinueWith((prevTask) => Debug.WriteLine(prevTask.Result)); }
  • 25. async Task<int> FuncAsync() { int r = await DoAsync(); return r; } • TAP과 함께 • APM/EAPTAP로 변환 • 비동기 함수의 이름은 XxxAsync()/XxxTaskAsync() • await 와 async는 함께 • 반환형은 Task, Task<TResult>
  • 26. private async void Button_Click(object sender, RoutedEventArgs e) { await WorkAsync(); } private async Task WorkAsync() { string url = "http://windowsteamblog.com/windows/b/windowsexperience/atom.aspx"; WebClient client = new WebClient(); string result = await client.DownloadStringTaskAsync(new Uri(url)); Debug.WriteLine(result); }
  • 27. Click async Task LoadSettingsAsync() { await IO.Network.DownloadAsync(path); } async void Button1_Click(){ await LoadSettingsAsync(); UpdateView(); } Click Messagepump Task ... DownloadAsync Task ... LoadSettingsAsync Download LoadSettings
  • 28. private void Button_Click(object sender, RoutedEventArgs e) { string url = "http://windowsteamblog.com/windows/b/windowsexperience/atom.aspx"; WebClient client = new WebClient(); Task<string> t = client.DownloadStringTaskAsync(new Uri(url)); t.ContinueWith((r) => Debug.WriteLine(r.Result)); } private async void Button_Click_1(object sender, RoutedEventArgs e) { string url = "http://windowsteamblog.com/windows/b/windowsexperience/atom.aspx"; WebClient client = new WebClient(); string result = await client.DownloadStringTaskAsync(new Uri(url)); Debug.WriteLine(result); } TAP with async/await TAP
  • 30. WinRT의 비동기 C++는 PPL C#, VB는 TPL과 async/await Javascript는 commonJS/A 의 promise/then
  • 31. + +
  • 33. public sealed class SyndicationClient : ISyndicationClient { public IAsyncOperationWithProgress<SyndicationFeed, RetrievalProgress> RetrieveFeedAsync(Uri uri); … } public sealed class SyndicationFeed : ISyndicationNode { public ISyndicationText Title { get; set; } … } public interface ISyndicationText : ISyndicationNode { string Text { get; set; } … }
  • 34. #include <ppltasks.h> void App::SetFeedText() { using namespace Windows::Web::Syndication; using namespace concurrency; String^ url = "http://windowsteamblog.com/windows_phone/b/wmdev/atom.aspx"; SyndicationClient^ client = ref new SyndicationClient(); task<SyndicationFeed^> retriveTask(client->RetrieveFeedAsync(ref new Uri(url))); retriveTask.then([this] (SyndicationFeed^ feed) { String ^title = feed->Title->Text; }); }
  • 35. function SetFeedText() { var url = "http://windowsteamblog.com/windows/b/windowsexperience/atom.aspx"; var client = Windows.Web.Syndication.SyndicationClient(); var feedOp = client.retrieveFeedAsync(new Windows.Foundation.Uri(url)); feedOp.then(function (feed) { var title = feed.title.text; }); }
  • 36. private async void SetFeedText() { string url = "http://windowsteamblog.com/windows/b/windowsexperience/atom.aspx"; SyndicationClient client = new SyndicationClient(); SyndicationFeed feed = await client.RetrieveFeedAsync(new Uri(url)); var title = feed.Title.Text; }
  • 37. async/await Use raw interface Multiple task Task Combination

Editor's Notes

  1. 소개
  2. 오늘은 이 질문으로부터 시작
  3. 비정상 종료는 다르나 나머지는 성능과 대체로 연관이 있음
  4. 응답하라 1987
  5. 무한루프. Logical Core가 4개임에도 사용율은 100%가 되지 못함
  6. NTFS Driver가 실제 작업을 수행함에도 사용자 Thread가 작업 완료까지 대기 하고 있음
  7. UI 응답성. UI Component는 자체적인 Thread Model이 있음, WinForm, WPF, Silverlight, IE 는 모두 STA/Console App은 없음 CPU 코어 수 = 실행 중 스레드 수를 만드려면. 수동으로 사용자가 스레드 개수를 제어하거나, 잘 짜여진 Thread Pool등을 사용하는 것이 좋음. Context Switching이란 결국 CPU의 상태를 저장하고/복원하는 과정 Windows는 30ms Quantium Time을 가짐 비동기 함수는 Win32, WPF, Siverlight, WP, W8까지 대체로 대부분 존재함. 특별히 Windows 8의 WinRT의 경우 50ms은 넘는 모든 작업들은 모두 비동기로만 제공하고 있음 대략 60%에 육박하는 수준의 I/O 기능들이 비동기로 수행
  8. 개념만 정리하면 3가지로 특징 지어질 수 있음 비동기는 작업 요청자와 작업 수행자가 다름 작업을 요청하는 다른 방식이 필요함 작업을 완료 통지를 받을 수 있는 방법이 필요함
  9. APM .NET framework 1.1 EAP .NET framework 2.0 TAP .NET Framework 4.0 APM과 EAP는 모두 쉽게 TAP형태로 변경해서 사용가능 병렬화 기법상의 Task parallelism 언급
  10. Sync/Tap이 signature 차원에서 가장 닮아있음 APM/EAP 모두 추가 method와 delegate type/event가 필요함
  11. event 결합
  12. Lamda expression Anonymous method Haskell과 같은 언어에서 많이 사용됨/nested function 하지만 Anonymous method 자체는 1936년 Lambda calculaus에서 정립됨 Closure 를 만들기 위한 것임. Lamda+ environment A closure is a lambda expression paired with an environment that binds each of its free variables to a value. In Java, lambda expressions will be implemented by means of closures, so the two terms have come to be used interchangeably in the community.
  13. 비동기 작업이 완료되면 디버그 출력 화면에 출력. 비동기 작업이 완료될 때 까지 스레드가 대기할 것임. Blocking이 발생 -> wait free/lock 로
  14. function composition 선행 task가 끝났을 때 수행할 Task Continuation 생성. Continuation chaining을 생성하여 효율을 도모할 수 있음
  15. Async/await가 C# 5.0에 추가 Async는 modifer이지만 method signature에 포함되지 않음 Task를 기반으로 동작함 언어가 library Type가 쌍을 이루어 돌아간(e.g. foreach/Ienumerable)
  16. Async는 Task /Task<Tresult> 만 혀용함 하지만 예외적으로 async void를 허용하긴 함. 그러나 최상위 event handler에서만 사용됨 Generics는 73년 ML 같은 언어에서 처음 출현 이후 Ada, Delphi, Eiffel, Java, C#, f#에서는 generics로 ML, Scala, Haskell에서는 parametric polymorphism으로 불림 C+은 template이라고 조금 다르긴 하지만 불림
  17. [CLICK] * In any UI application, Winforms/WPF/Silverlight/Phone/Win8, the UI thread runs a loop * When a click arrives, it invokes the handler. [CLICK] * When async method hits first await, returns to its caller. [CLICK] * When it hits first await, ... you know the drill [CLICK] * Back to the message-loop. That's why it's responsive, and ready to handle more UI interactions. * Doesn't freeze. [CLICK] * Later on, let's say the network download has finished. * Task gets marked as completed, and if UI thread is free, can resume where it left off. * That's going to be: finish the method [CLICK] * And so the task gets marked as completed, and again the UI thread can resume where it left off. * Okay, that's the mechanism. * Even if you don't follow, that's fine, we'll spell out the practical ramifications.
  18. 순수 TAP와 TAW With async/await의 코드를 비교.
  19. Completed와 같은 event handler, Cancel, Progress 등이 있음. EAP와 Pattern이 일치
  20. C++/CX는 WinRT를 사용하기 위한 확장으로 객체 생성시 ref new/참조시 caret(^)를 사용함.
  21. 앞서 우리가 살펴보았던 UI 응답성의 문제/비효율적 CPU 사용의 문제 그리고/비효율적인 I/O의 문제등을 해결하기 위해서 비동기 함수 호출 메커니즘은 필수 불가결한 요소가 되었음. Win32에서 WinForm, Siverlight, WinRT와 같은 Framework과 함께 C++의 PPL/C#의 TPL/Javascript CommonJS/A proposal등의 library를 제공하고 있으며, 더 나아가 async/await와 같은 강력한 언어 규격을 추가하였음. 비동기 프로그래밍은 이제 하면 좋은 것이 아니라 반드시 해야 하는 필수적인 요소로 부각되고 있음. 이는 Mobile/Desktop/Server Application이 이르기 까지 예외없이 적용되며, 분산환경의 서버에 도입될 경우 그 기대효과가 더 크다고 할 것임
  22. 부족한 내용이나마 도움이 되셨길 바라고, 참석해 주신 여러분께 다시 한번 감사의 말씀을 드립니다. 감사합니다.