473,396 Members | 2,039 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Cancel cin

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?

Thanks in advance for your help.

Mike.
Jul 22 '05 #1
4 3268
"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
Jul 22 '05 #2


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++.

Mike.
Jul 22 '05 #3
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.


cin is an object. You can't "cancel" objects. That's what confuses
people here. What you probably meant was cancelling an input operation
that reads from cin.
Also, later I might want to issue another cin.
cin is still the same object.
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++.


Yes, cin is part of C++, but again, threads are _not_. But if you don't
have threads, cancelling a blocking operation doesn't make sense (who
would cancel it, if not another thread?), and so there is no way to do
that in standard C++.

Jul 22 '05 #4
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.
Jul 22 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: AP | last post by:
Hi, I'm trying to use c# to pop up a dialog box when a user attempts to close word to prompt them if they want to exit or cancel (obviously other stuff needs to happen based on their selection...
13
by: Mike L | last post by:
I have a child form frmDataEntry call up another child form frmDealerSearch. If the user clicks on cancel on frmDealerSearch, I want to close frmDealerSearch and put the focus on txtDealerNum on...
14
by: clintonG | last post by:
This is an appeal for peer support sent to Microsoft as will be noted in closing. The Login control does not include a Cancel button. The only option is to convert the Login control to a...
3
by: Charles Law | last post by:
Under what circumstances would e.Cancel be set to True on entry to the Closing event of an MDI child form? I have found that this is why my application won't close properly. I can explicitly set...
21
by: Darin | last post by:
I have a form w/ a textbox and Cancel button on it. I have a routine to handle textbox.validating, and I have the form setup so the Cancel button is the Cancel button. WHen the user clicks on...
2
by: Robinson | last post by:
I can start an Asynchronous operation against a data source with SQLCommand.BeginExecuteReader, allowing me to loop, checking for user cancellation before the operation has completed, but how then...
4
by: Academic | last post by:
Does it make sense to put this If e.Cancel Then Exit Sub at the beginning of form closing events so if the user cancels the app's exiting in one Closing routine he will not be asked again by...
2
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I change the confirm box to say yes/no or default to cancel?...
16
by: parez | last post by:
I start a BackGroundWorker to populate a grid. It is started off in the ui layer The thread follows( cannot think of a better word) the path UI->Layer1->Layer2->Communication Layer and it...
5
by: ghjk | last post by:
I have "cancel" button in php files. I want to write common javascript function for cancel button. When user click cancel button I want to clear php form data. Is it possible? <input id="Cancel"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.