From: Matthew Smillie Date: 2006-03-28T17:57:42+09:00 Subject: Re: input without blocking On Mar 28, 2006, at 5:48, brian yahn wrote: > I'm just trying to get the characters being input into the program and > run it at the same time without a thread. A thread is not needed > in c++ > to do this. In the simple case, a thread isn't needed anywhere: --- Ruby --- STDIN.print "Type away: " STDIN.flush 10.times do #something pointlessly time-consuming end input = STDIN.gets puts "You typed: #{input}" --- C++ --- #include #include using namespace std; int main() { cout >> "Type away: " for (int i = 0; i < 10; i++) { // something pointlessly time-consuming } string input; cin >> input; cout << "You typed: " << input << "\n" return 0; } No thread, no blocking (unless the typist is particularly slow). The C++ version, if you run it, will only grab one word from the input, but as an example I'm sure you get the idea. Apart from that sort of thing, I'd be interested to know exactly how C ++ doesn't require a separate thread/process to handle input. I suspect that it's simply just being created by whatever library you're using. matthew smillie.