いまさら 恥 ずかしくて async を await した

  • Published on
    16-Feb-2016

  • View
    51

  • Download
    0

Embed Size (px)

DESCRIPTION

async await . 9 in Kouji Matsui (@kekyo2). Profile. Twitter:@kekyo2 Blog:kekyo.wordpress.com orz . Agenda. Hello world LINQ . . - PowerPoint PPT Presentation

Transcript

asyncawait9 in Kouji Matsui (@kekyo2)

Profile Twitter:@kekyo2 Blog:kekyo.wordpress.com orz

AgendaHello worldLINQ

WinRTASP.NET http://gihyo.jp/dev/serial/01/grani/0001

C# 2.0CJava

ex : switch-caseCPUOS

async-awaitHello

ZIP

ZIPGUIGUI ZIPJPEGGUI

^Y^Y^Y^Y^Y^Y

Hello awaitusingDispose

Hello GUI

Hello await

awaitC# 4.0ContinueWith

awaitasync-awaitawaitawaitDispatcherGUITaskSynchronizationContext

awaitOKWPF/WP/

AsyncTaskasync-await

GUI

HttpClientHTTPGUI

ExtractImagesExtractImagesObservableCollectionAddListBox

ZIPJPEGZipReader(ShartCompress) ZipReaderJpegBitmapDecoder

System.Threading.ThreadSystem.Threading.ThreadSystem.Threading.ThreadPool.QueueUserWorkItemTaskRunTask.Run()

TaskThreadPoolTask

Task.RunDispatcherTask.RunTask

TaskawaitawaitDisposeABCTaskCompletionSourceTaskThreadGitHubAPIAPIWinRTAPIAPI

vs Task.RunTask.RunThreadPoolCPUCPUCPU Work OffLoadsCPUBlog http://kekyo.wordpress.com/category/net/async/

Task.RunCPUAPIAPICPU

LINQLINQ TaskIEnumerator.MoveNext()

EntityFrameworkMoveNextAsync

RxTIEnumerableTaskLINQ (Pull)TTTTT (Push)ObserverObservableIObservableReactive Extensions (Push)

RxLINQRxDispatcherTaskLINQRxIEnumerable01234ToObservable()

01234PullPushObserveOnDispatcher()

ForEachAsync()TaskTaskWPFListBoxObservableCollectionBindingRxLINQIObservableforeachLINQawaithttp://channel9.msdn.com/Shows/Going+Deep/Rx-Update-Async-support-IAsyncEnumerable-and-more-with-Jeff-and-WesRxObservable

xin9le : Rxhttp://xin9le.net/rx-intro x^2=-1

www

error CS1996: 'await' lock TaskTaskManualResetEvent, AutoResetEvent, Mutex, SemaphoreTaskMonitor.EnterWaitHAndle.WaitAny/WaitAllawaitable Nito.AsyncEx NuGet

awaitlockAsyncSemaphore

TaskTask.RunCPUCPUTask.RunTaskLINQRx

GitHubhttps://github.com/kekyo/AsyncAwaitDemonstrationhttp://kekyo.wordpress.com/