en
Wouter de Kort

Exam Ref 70–483: Programming in C#

Сообщить о появлении
Загрузите файл EPUB или FB2 на Букмейт — и начинайте читать книгу бесплатно. Как загрузить книгу?
  • Mike Petrov-Vodkinцитирует8 лет назад
    The SynchronizationContext abstracts the way these different applications work and makes sure that you end up on the right thread when you need to update something on the UI or process a web request
  • Mike Petrov-Vodkinцитирует8 лет назад
    public Task SleepAsyncA(int millisecondsTimeout)
    {
    return Task.Run(() => Thread.Sleep(millisecondsTimeout));
    }
    public Task SleepAsyncB(int millisecondsTimeout)
    {
    TaskCompletionSource<bool> tcs = null;
    var t = new Timer(delegate { tcs.TrySetResult(true); }, null, -1, -1);
    tcs = new TaskCompletionSource<bool>(t);
    t.Change(millisecondsTimeout, -1);
    return tcs.Task;
    }
  • Mike Petrov-Vodkinцитирует8 лет назад
    You should use the Parallel class only when your code doesn’t have to be executed sequentially
fb2epub
Перетащите файлы сюда, не более 5 за один раз