Generator (computer programming): Difference between revisions

Content deleted Content added
Timeline: added date for python (2001). what's a timeline with no dates :-)
Tags: Mobile edit Mobile web edit Advanced mobile edit
Line 88:
===C===
 
[[C (programming language)|C]] does not have generator functions as a language construct, but, as they are a subset of [[coroutines]], it is simple to implement them using any framework that implements stackful coroutines, such as libdill.<ref>{{cite web|url=http://libdill.org|title=Structured Concurrency for C}}</ref>. On POSIX platforms, when the cost of [[context switching]] per iteration is not a concern, and/or full [[Parallel_computing|parallelism]] rather than merely [[Concurrency (computer_science)|concurrency]] is desired, a very simple generator function framework can be implemented using [[pthreads]] and [[Anonymous_pipe|pipes]].
 
===C++===