Boost logo

Boost :

From: Beman Dawes (bdawes_at_[hidden])
Date: 2001-12-12 09:22:08


At 04:13 AM 12/12/2001, p_michel_andre wrote:

>I was one of the guys proposing a solution to Beman for the Alarm
>feature in NT. My solution doesn't use Terminate thread. Below is a
>short description:
>
>The alarm class creates an external thread to handle the timeout and
>if an timeout occurs the external thread suspends the original thread
>and perfoms a GetThreadContexts and sets the x86 Eip program counter
>to a function that raises an user defined software exception which
>then can be caught via NT:s exception mechanism (and rethrown as an
>C++ exception to be caught). The interface was something like:
>try
>{
> Alarm alarm(1000); // timeout in msecs
> lenghty_call(); // call that takes more than 1000 msecs
>}
>catch(Alarm::Timeout&)
>{
> std::cout << "Timeout occured!";
>}
>
>But that can of course be changed.
>
>
>Actually I havent got the code. Maybe Beman still has it. Ive had a
>disk crash so i have to rewrite it or reload an backup.

It has disappeared from my hard disk too. Let me check backups.

Wow! That was fast. CD backups make it much easier to recover single
files than from the tape system I used to use.

See attached.

--Beman



Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk