On 14 Jun 2012, at 05:12, Graham Cox wrote:


On 14/06/2012, at 8:03 AM, Dave wrote:

In assembler this would be implemented is using an "Exchange Instruction" to alter the PC on the stack and cause it to return to the correct place once the ASync Task (usually an interrupt) had finished.


Ah, those were the days - push a calculated address on the stack and do a 'RET' to cause a jump to that address... thankfully such tricks are wholly unnecessary these days. In fact a simple switch...case statement does the same job in most cases.

I'm not sure of the answer to your question though, seems to me you could simply queue each task then the next executes as soon as the one ahead of it finishes.


The point is you can't queue B until the data from A has been obtained and that might take a long while. There are two ways to deal with it, either have a call back from the lower level that returns the data (in which case you have to specify an address/selector to go to when the data has been obtained sucessfully), OR you can invert the control and make the interface look as it is demand based, even though the data is being obtained as and when it is ready.

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to