Force a program to stop if runtime exceeds given duration

  • Thread starter Aldric Giacomoni
  • Start date
A

Aldric Giacomoni

I'm in the same boat here at work. Fork won't work in Windows so that
option is out. However if the thread or timeout suggestions don't work for
you it might be possible to adjust Robert's suggestion to run as a Windows
Task. I don't know if you can put a time limit on a task though (don't use
them very often)

It is possible - that is currently how I'm doing it. Part of my MO,
however, is to minimize required work and setup -- the fewer steps, the
fewer chances of screw-ups !
 
R

Robert Dober

Everybody automatically assumes that rubyists are using Linux - sadly, in
the medical field Linux is not an option unless you're working with the
modality itself. Medical software is almost all Windows-based.. So, Windows
is where I am for this issue and Windows is where I remain :(
Hmm to bad wine is not making more progress. However if you cannot
bring WIndows to Linux, there are still some ways to mimick an OS
behaviour on Windows, cygwin might be an overkill for this but what
about Msys?
Sorry for the OT but this still might be helpful for some folks.
http://mingw.org/node/18

Mingw/Msys is minimal but you get bash and actually that is all you need

ruby <your prog> &
echo "kill $!" > /tmp/xxx
sleep 300 && bash /tmp/xxx

potentially "nohup" the last command
N.B. You can even run ruby in the foreground if you get the PID and issue
sleep 300 && kill <PID>
in a different shell

Cheers
Robert
 
M

Marvin M Arnold

Hi,

I am a student at MIT founding a non-profit, with the mission to
increase the number of college students who do meaningful community
service. We are a young team, and looking for individuals with more
rails experience to help with the development of the site.

While the mission may sound generic, I ensure you we have very unique
ideas with a lot of growth potential. Also, although this is a 501(c)(3)
venture, our business model is still very profitable. I can provide more
information upon request. Please respond to maarnold [-!at!-] mit
[!-dot-!] edu.

Thanks,

PS- Sorry if this is a repost, not sure if it went through.
 
R

Robert Klemme

PS- Sorry if this is a repost, not sure if it went through.

According to my news reader you hijacked another thread. This is a bit
impolite and also may not get you the attention you are trying to get.

Regards

robert
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,184
Messages
2,570,979
Members
47,578
Latest member
LC_06

Latest Threads

Top