Implementing a Timeout in C/C++



Hello all -

I am attempting to implement a timeout condition in C/C++ and am
finding very little resources on doing such a thing. In ADA, I would
do something like this:

select
accept An_Entry do
end An_Entry;
or
delay 5.0;
Put("An_Entry: timeout");
end select;

but don't confuse ADA's select() with C's...

Anyway, what I'm trying to do is:

while (ERROR_CONDITION)
{
<Wait for either 10 Seconds to expire or ERROR_CONDITION == 0>
}

basically, a straitforward timeout...

Is there anyway to achieve this without using sleep? I have other
actions going on in the background that I don't want to suspend, I just
want a max-timed while loop - is that possible?? Trivial??

Thanks,
Wade

.



Relevant Pages

  • Re: Implementing a Timeout in C/C++
    ... I am attempting to implement a timeout condition in C/C++ and am ... finding very little resources on doing such a thing. ... In ADA, I would ...
    (comp.unix.programmer)
  • Re: If you ran the ADA...
    ... The main issue is whether or not people employed by the ADA ... resources that should ensure adequate quality control on all its ... to more financial resources and research information than most any ... While some people might take some interest in conspiracy theories ...
    (alt.support.diabetes)
  • Re: Robert Dewars great article about the Strengths of Ada over other langauges in multiprocessing!
    ... I have been reading these articles in EE Times and elsewhere ... acting as though Ada never existed. ... GNAT indirectly inherits most C/C++ ambiguities regarding concurrency ...
    (comp.lang.ada)
  • Re: Re-Marketing Ada (was "With and use")
    ... Ada suffers from two main ... C/C++ can use the include files, ... The Ada programmer must work around header files, ... For #2, I am grateful for GNAT, and all that it has done. ...
    (comp.lang.ada)
  • GNAT and Florist
    ... I'm trying to learn Ada95 since a couple of months, coming from C/C++. ... I use GNAT compiler on Linux and I want to write an Ada program that ... It's not clear to me which packages I have to use, ...
    (comp.lang.ada)