Link Details

Link 970029 thumbnail
User 454796 avatar

By Andrey_Karpov_2009
via aldrin.co
Submitted: May 16 2013 / 15:13

An ideal subroutine is a mathematical function; it takes inputs and returns the results of its computation. It has a single entry point and all data local to it is initialized upon entry and cleaned up when it returns to the caller. The next call, if any, starts all over again and no local residues are carried over from the last invocation. A coroutine, is an interesting deviation from these conventions. It can yield control back to the caller as soon as there are partial results that can be put to use. Moreover, when invoked again, it can resume the computation from where it left. These yield/resume semantics make coroutines a better unit of structuring programs for certain types of problems.
  • 3
  • 0
  • 145
  • 48

Add your comment


Html tags not supported. Reply is editable for 5 minutes. Use [code lang="java|ruby|sql|css|xml"][/code] to post code snippets.

Voters For This Link (3)



Voters Against This Link (0)



    Java Performance Optimization
    Written by: Pierre-Hugues Charbonneau
    Featured Refcardz: Top Refcardz:
    1. Design Patterns
    2. OO JS
    3. Cont. Delivery
    4. Java EE7
    5. HTML5 Mobile
    1. Node.js
    2. Debugging JavaScript
    3. OO JS
    4. JSON
    5. Ajax