Changeset b54118a
- Timestamp:
- Jun 7, 2020, 12:28:06 PM (4 years ago)
- Branches:
- ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- ee06db5c
- Parents:
- 393d59a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/papers/concurrency/response2
r393d59a rb54118a 692 692 choosing between a generator or coroutine; either form can receive (input) or 693 693 return (output) millions of values. As well, simple versus complex computations 694 is also not a criterion for selection as both forms can be very 695 sophisticated. As stated in the paper, a coroutine brings generality to the 696 implementation because of the addition stack, whereas generators have 697 restrictions on standard software-engining practices: variable placement, no 698 helper functions without creating an explicit generator stack, and no symmetric 699 control-flow. 694 is also not an absolute criterion for selection as both forms can be simple or 695 complex. 696 697 As stated in the paper, a coroutine brings generality to the implementation 698 because of the addition stack, whereas generators have restrictions on standard 699 software-engineering practices: variable placement, no helper functions without 700 creating an explicit generator stack, and no symmetric control-flow. It is 701 true that simple generators probably suffer less from restrictions. Also, 702 simplicity means the amount of work done is small so the cost of the 703 suspend/resume becomes a factor, where experiments show suspend/resume for a 704 generator is 10 times faster than for a coroutines. 705 700 706 701 707 * prefer threads for cases where parallel execution is desired or needed.
Note: See TracChangeset
for help on using the changeset viewer.