On 9/4/07, Nico Heinze <[EMAIL PROTECTED]> wrote:

> One alternative might be to use a multi-threaded application; one
> thread starts a timer which will run 10 minutes; the other thread
> invokes getline(). If the timer expires before the getline() thread
> has finished, then stop the getline() thread and proceed as you like.
> Brute force but the only way I see without diving right into Windows
> programming including all its message-based architecture; in this
> point I totally agree with Brett and Thomas.

One could also use signals or some kind of IPC between a parent and
child process. But that's probably overkill for something like this.
:-P I'd go with the event-driven architecture. I once spent 3 months
working on a telecommunications application using multiple-processes
and a parent 'monitor' (the number of processes being dependent on how
many incoming lines the hardware supported), to handle telephony I/O
similar to how Apache handles requests, pre-fork a bunch of processes
and do a round robin kind of thing to dispatch requests off. It was
painful to say, the least... and then I discovered that the hardware
had an alternate event-based API that would have made life a lot
easier, but it was too late... I had left the project at that point.
:-(

-- Brett
------------------------------------------------------------
"In the rhythm of music a secret is hidden;
    If I were to divulge it, it would overturn the world."
               -- Jelaleddin Rumi

Reply via email to