Mike - EMAIL IGNORED wrote:
Victor Bazarov wrote:
"Mike - EMAIL IGNORED" <m_*************@yahoo.com> wrote...
Using RoseRT with RedHat 8.0, I have a thread that is
waiting for a cin, and another thread that wants to
cancel the cin without waiting for a response from
the keyboard. I tried destroying the thread that
issued the cin, but it didn't die until the keyboard
responded. Any suggestions?
What does it mean "to cancel the cin"? Also, consider
posting to a newsgroup where threads are on topic, like
your OS newsgroup or comp.programming.threads. C++ has
no means to manage threads yet. It's all platform-
specific.
V
By "to cancel the cin" I mean to cause the cin to stop block
ing and waiting for input. Also, later I might want to issue
another cin. Thanks four your advice on where to post -- we
are way ahead of you. I was under the impression that cin has
something to do with C++.
There is only one "cin", and its name is "cin" or "std::cin", not "the
cin". It's an object, not something you can "issue", "cancel" or do
anything else with apart from calling the functions in its public
interface, istream.
Your question is off-topic in this newsgroup. There's no point in being
cross when someone points that out.
Your problem is that terminal input with cin is not flexible enough to
do what you want to do. What you need to do is possible (examine the
readline library sources for hints) but not portably. It might be easier
to write an X application and use events for control. This is how most
"real-time" interactive programs are written (perhaps you have noticed
this).
Regards,
Buster.