Boost logo

Boost :

From: rogeeff (rogeeff_at_[hidden])
Date: 2001-12-20 12:30:31


--- In boost_at_y..., Beman Dawes <bdawes_at_a...> wrote:
> At 04:05 AM 12/19/2001, rogeeff wrote:
>
> >Hi,
> >
> >After considering several possible solutions for implementing
> >function timeout in WIN32 platform. it seems that there is no
> >reliable solution based on async. canselation. Here what I
propose:
> >
> >1. As usual we need Timer thread. It could be new thread started
> >every time we need to run test case with timeout. It could be
current
> >thread while test case run in new one. It could be permanent
thread
> >responsible for timeouts.
> >2. Implementation will assume *synchronous* cancelation. This mean
> >that when timeout occured Timer thread will set some 'timeout
flag'
> >which will be checked with every access to the framework. Now the
> >user responcibility is to make sure that test case accessing
> >framework frequently enough.
>
> A typical reason for a timeout is that a test case is looping.
Given that
> Boost (and others) often are dealing with testing libraries, the
loop is
> often deep inside some library component. How can we "make sure
that test
> case [is] accessing [the] framework frequently enough"?
>
> Or am I misunderstanding something?

You are right. I perfectly understand that in most cases it will be
difficult to expect a looping inside a test case. But it could be. In
all the other cases we will get a fatal error. At an expense of a
more complex solution I can provide an option for the user to allow
the async. cancelation. But in this case the user is responsable for
consequences.

>
> >3. Timer thread will set internal timeout in, let say, 1 second
while
> >it will wait for current test case to complete. If timeout will
> >occured. we consider this as a fatal error and abort testing.
>
> --Beman

Gennadiy.


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