Generator (computer programming): Difference between revisions

Content deleted Content added
Uses: Removed link from "sequence expression" to the F# programming language page because the immediately preceding "F#" now links to that page.
C: fixed grammar error
Line 98:
===C===
 
[[C (programming language)|C]] does not have generator functions as a language construct, but, as they are a subset of [[coroutines]], but 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++===