Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coroutines

Status
Not open for further replies.

sroohani

Programmer
Jan 18, 2003
11
ES
Hi there,

I know perhaps this is not the right place to ask this question. But since I do my code in C++, I prefered to ask C++ programmers.

I surfed the net and found some description about coroutines in different programming languages. Does any one know which languages support coroutines and does C++ support coroutines?

Thanks,
Shahram
 
As C++ knows nothing of threads and threading coroutines are not built in to the language. C++ can support coroutines though if the features of an operating system are used. POSIX and Win32 threads can both be used to support coroutines in C++.
 
The only language I know of that supports coroutines is Modula-2.

For those who don't know what a co-routine is, have a look at
http://www.sidhe.org/~dan/blog/archives/000178.html

In windows, you may be able to implement it using fibers. Some Windows books have, at most about half a page on fibers.
 
Yeah, Modula-2 supports co-routines but, I think Ada does as well (memory hazy; worked very little bit with Ada compiler about 12 = 14 years ago).

[tt]________________________________________________________________
[pc2]Roger
Life is a game of cards in which the deck contains only jokers.[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top