Comments on: Solving Problems With Asynchrony: Asset Loading [...] Solving Problems With Asynchrony: Asset Loading [...] [...] Solving Problems With Asynchrony: Asset Loading [...]

]]>
By: Solving Problems With Asynchrony: Asset Loading » #AltDevBlogADay | Solve Math & Science Problems - Solveable.com/2011/04/19/solving-problems-with-asynchrony-asset-loading/#comment-3867 Solving Problems With Asynchrony: Asset Loading » #AltDevBlogADay | Solve Math & Science Problems - Solveable.com Wed, 11 May 2011 07:17:23 +0000 You can use BeginRead/BeginWrite against files and sockets on the desktop .NET runtime. On platforms without non-blocking IO mechanisms, yeah, you'd want to use an IO thread. You can use BeginRead/BeginWrite against files and sockets on the desktop .NET runtime. On platforms without non-blocking IO mechanisms, yeah, you’d want to use an IO thread.

]]>
By: Martijn/2011/04/19/solving-problems-with-asynchrony-asset-loading/#comment-3433 Martijn Sun, 01 May 2011 20:53:34 +0000 You can pipeline the disk IO so you're only doing one read at once (or, for example, if some of your assets are on a console's hard disk and some are on the game's DVD, do one IO from each storage device at a time), but still do things like texture decompression, etc. on-CPU in parallel. You can pipeline the disk IO so you’re only doing one read at once (or, for example, if some of your assets are on a console’s hard disk and some are on the game’s DVD, do one IO from each storage device at a time), but still do things like texture decompression, etc. on-CPU in parallel.

]]>
By: snake5/2011/04/19/solving-problems-with-asynchrony-asset-loading/#comment-2992 snake5 Tue, 19 Apr 2011 19:32:05 +0000 It's possible you could write an awaiter to do the thread marshalling for you, yeah - I don't know whether they've sorted out the default behavior there. It’s possible you could write an awaiter to do the thread marshalling for you, yeah – I don’t know whether they’ve sorted out the default behavior there.

]]>
By: Rob Ashton/2011/04/19/solving-problems-with-asynchrony-asset-loading/#comment-2967 Rob Ashton Tue, 19 Apr 2011 11:00:29 +0000 I've actually corresponded at length with the guys developing the C#5 Async implementation and I plan to use it once it's out. Their async component basically replaces the enumerator functions in my examples, and Futures remain as useful as ever. (They include a similar implementation of the concept; lots of semantic differences and an unfortunate name, but it solves similar problems.) One smart decision they made is that you can await any object that provides a GetAwaiter method, instead of it having to be of a specific type. One key distinction is that async/await in C#5 doesn't provide any assistance with thread safety and synchronization, since it just chains callbacks - the callback that resumes your async function can end up running on any thread in your process. To tackle that problem, you still end up needing some sort of work scheduler, but async still makes your life easier. I’ve actually corresponded at length with the guys developing the C#5 Async implementation and I plan to use it once it’s out. Their async component basically replaces the enumerator functions in my examples, and Futures remain as useful as ever. (They include a similar implementation of the concept; lots of semantic differences and an unfortunate name, but it solves similar problems.) One smart decision they made is that you can await any object that provides a GetAwaiter method, instead of it having to be of a specific type.

One key distinction is that async/await in C#5 doesn’t provide any assistance with thread safety and synchronization, since it just chains callbacks – the callback that resumes your async function can end up running on any thread in your process. To tackle that problem, you still end up needing some sort of work scheduler, but async still makes your life easier.

]]>
By: Rob Ashton/2011/04/19/solving-problems-with-asynchrony-asset-loading/#comment-2963 Rob Ashton Tue, 19 Apr 2011 09:00:19 +0000