пятница, 29 октября 2010 г.

Async CTP KNOWN ISSUES

KNOWN ISSUES

  1. Asynchrony does NOT imply background thread. Merely sticking the "Async" modifier will not make a method run on the background thread. That is correct and by design. If you want to run code on a background thread, use TaskEx.Run(). Please read the overview for an explanation of asynchrony.
  2. Debugging is not yet implemented.
    1. Exceptions: please go to Tools > Options > Debugging and disable "Just My Code". (Otherwise, you'll be warned about unhandled exceptions even when they are handled).
    2. Stepping - Pressing "F10" on an Await statement doesnТt currently do what it should.
    3. Local variables - in VB, local variables in async+iterator methods don't currently show up in VB's watch window and you can't inspect them.
  3. Framework extensions
    1. Await TaskEx.Delay(ms) is the async equivalent of Thread.Sleep(ms). If you forget the "await" keyword here, it will create a task that delays, but your own function will carry on immediately Ц usually not the intention!
    2. Await WebClient.DownloadStringTaskAsync(uri) is the async equivalent of WebClient.DownloadStringAsync(uri)
    3. TaskEx - this CTP uses System.Threading.Tasks.TaskEx for its additions to the normal System.Threading.Tasks.Task. That's because we didnТt want to modify existing framework DLLs for the CTP. TaskEx will not be their permanent home.
  4. Language issues - there are several corners of the async feature that are not yet implemented in VB or C#.
    1. All the new keywords will be contextual keywords so as to avoid backwards-compatibility breaks. But in the current CTP, they're currently reserved keywords.
    2. In edge cases it gets the wrong order of evaluation. For instance, "f() + await g()" will evaluate g() before f(). In particular, for a given statement, it evaluates all "await" subexpressions prior to the rest of the statement.
    3. Overload resolution is not yet implemented for async or iterator lambdas. For instance, if there are two overloads f(Action) and f(Func<Task>) and you invoke it with "f(async delegate {})" then it should pick the latter but currently picks the former.
    4. Generic method inference is not yet implemented for async or iterator lambdas. For instance, if there a method g<T>(Func<T>) and you invoke it with "f(async delegate {return 5;})", then it should infer T=integer but currently doesn't
    5. Async expression lambdas are not yet implemented in the current CTP
    6. Late-bound await expressions are not yet implemented in the current CTP

Комментариев нет:

Linux.org.ru News

Вебпланета - все новости

CNews - Издание о высоких технологиях