460839 (2) [Avatar] Offline
#1
Hello, reading chapter 5 (really difficult because there is a lot of notion hidden (concurrency, asynchonous, thread (logical and hardware), process, multithreading, multitasking, parallels, process...)).


I'm not sure I understand this part well :

5.8 Custom task types in C# 7
...
As a reminder, the async/await feature has always allowed us to await custom types that follow the awaitable pattern. The new feature here permits writing an async method that returns a custom type.



It makes no sense, for me. Did you mean value type ? Or Did you mean a custom type witch not follow the awaitable pattern (though you say few lines after "Obviously a custom task type has to implement the awaitable pattern, but there’s much more to it than that") ?
jon.skeet (481) [Avatar] Offline
#2
> Did you mean value type ?

No, I meant a custom type instead of Task or Task<T>. The custom type still has to implement the awaitable pattern, but there can be types other than Task that do that - such as ValueTask<T>.
460839 (2) [Avatar] Offline
#3
Ok, I got it.

Thank you.