Solved

Equivalent of alram() call in VC++?

Posted on 1998-02-07
6
218 Views
Last Modified: 2010-04-10
Hi,

Is there any function call similar to unix alram call in VC++ on Win 95 system. I need to use it to terminate a program which hangs. If not is there a work around for this.
0
Comment
Question by:bagalp
6 Comments
 
LVL 3

Expert Comment

by:q2guo
ID: 1181098
I think raise() is the function you are looking for

<signal.h>
int raise( int sig )

0
 

Author Comment

by:bagalp
ID: 1181099
I want a function call which can be used to time out the program which calls it. Using raise() I will need another process to keep track of this process. raise() is equivalent to a signal() call in UNIX. Here I have a program which potentially hangs. So I need something using which I can time out this program. That is equivalent of alram() call in unix.

Sorry if I was not clear during my first question.
0
 
LVL 7

Expert Comment

by:galkin
ID: 1181100
Create another thread with higher priority which would spy main thread and if it sees main thread has hung it will terminate it.

0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:bagalp
ID: 1181101
Thanks for the work around.

Does this mean that VC++ has no concept of timing out an application.



0
 
LVL 32

Accepted Solution

by:
jhance earned 200 total points
ID: 1181102
If you need to time out after a specified period of time, use a timer (SetTimer() function).  When the time fires, you application will get a message and you can do whatever it is that needs to be done.  
0
 

Author Comment

by:bagalp
ID: 1181103
OK that's something that will give me some control over the application.

Thanks for your time.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question