Re: rebuilding expect with different timer
- From: "James Harper XX (AS/EAB)" <james.xx.harper@xxxxxxxxxxxx>
- Date: Tue, 04 Jul 2006 17:03:13 +0200
On 2006-07-04 16:54, Jeff Hobbs wrote:
James Harper XX (AS/EAB) wrote:Its 5.43
On 2006-07-04 08:00, Jeff Hobbs wrote:
Donal K. Fellows wrote:
James Harper XX (AS/EAB) wrote:
Has anybody rebuilt expect to do this and if so any help on where to
start would be useful.
[...]
The two areas that will require the different timing information are the
sleep command and handling timeouts.
There is a time virtualization API in Tcl 8.5's C interface. I don't
know how Expect handles time, but if it does it on top of Tcl's time
handling core, it should pick up the virtual times if you set them up.
But I'm not an expert on actually using the virtual time stuff, so I
can't offer detailed help.
Indeed, this is exactly why those APIs were introduced - to allow for Tcl and extensions built on Tcl that use Tcl_Time-based APIs to get a skewed sense of time. The time virtualization API should be fully sufficient for simulating both slower and faster time.
I have had a look at the expect source code and in particular expect.c, I believe the timeout handling code use the system function time(&time_t). However the sleep procedure uses Tcl_CreateTimerHandler, is this a procedure that can use the API's you talk about? We have Tcl8.4 installed and it might not be possible to upgrade to 8.5 for a while.
Which expect source base are you looking at? In conjunction with this patch to Tcl, Expect and TclX received patches to ensure that they use Tcl_Time-based handling everywhere.
Our organisation uses Tcl 8.4 and expect 5.43 and as you can see from my email address we are quite a big organisation and changing which versions we use from the two mentioned will probably take a lot more time than implementing some code to use simulated times ;)
.
- Follow-Ups:
- Re: rebuilding expect with different timer
- From: Donal K. Fellows
- Re: rebuilding expect with different timer
- References:
- rebuilding expect with different timer
- From: James Harper XX (AS/EAB)
- Re: rebuilding expect with different timer
- From: Donal K. Fellows
- Re: rebuilding expect with different timer
- From: Jeff Hobbs
- Re: rebuilding expect with different timer
- From: James Harper XX (AS/EAB)
- Re: rebuilding expect with different timer
- From: Jeff Hobbs
- rebuilding expect with different timer
- Prev by Date: Re: Sharing C commands across threads
- Next by Date: Re: rename return
- Previous by thread: Re: rebuilding expect with different timer
- Next by thread: Re: rebuilding expect with different timer
- Index(es):
Relevant Pages
|