Re: 2 question or ask for the links
- From: Don Libes <libes@xxxxxxxx>
- Date: 17 Oct 2005 11:09:10 -0400
ms <sebamANTY@xxxxxxxxxxxxxxxxxx> writes:
> >>
> >>>>- is it possible that (my code working with 3 spawn_id) one part from
> >>>>firest id overtake the second id part although the second id part as
> >>>>code is before the first id part; I try to ask is that threads could be
> >>>>independence each other if I don't code any checkpoint for them?
> >>>
> >>>
> >>>Yes, that can happen.
> >>
> >>So in this case I can to something lake this:
> >>
> >>#spawn_id_1
> >>expect something
> >>send -i spawn_id_2 "Now your turn"
> >>set spawn_id spawn_id_2
> >>expect "Now your turn"
> >>send something
> >>expect something_else
> >>
> >>and I can be sure that spawn_id_2 won't override spawn_id_1? Is my
> >>thinking is corrent?
> >
> >
> > I'm don't know what you mean by "override" in this context so I don't
> > know how to interpret your question.
> >
> > Don
> First I want to say sorry for that I don't recognite with I speaking
> now. I want to say that expect is a the best tool which I have ever been
> working.
>
> Now my problem:
> I coded some program. This program work on the 3 spawn_id:
> - first spawn_id connect to serber and reading log's file
> - second spawn_id connect in special way to the same server and make
> some event e.g. sending files
> - third spanw_id connect to the same place as first spawn_id but check
> another think in middle procesing started by second spawn_id and all the
> time observed by first spawn_id
>
> Now starnge situation on the one server all goes ok, but when I moved
> this code without any changes on the another server this code started
> behave in inexplicable way for me.
>
> I use log_file to make file which will write everything to my program
> send and receive. So I know everything after close my program that's why
> I can describe what happens.For example:
>
> /In code/
> 1-st spawn_id
> I send file to server, then I wait for recieve info about succesfull
> this operation.
> 2-st spawn_id
> I check is there file really is correct send, when that is.
> 1-st spanw_id
> I send command to continuation some process on the this new file.
> 3-rd spawn_id
> I observe what is happen during procesing file by reading log's file.
>
> /My log file have written during work this code/
> There are info in file in bad order e.g.:
> 1.sending file (ok that was first)
> 2.checking recieve file (ok that was second opeartion)
> 3.do something but not that should do i.e. I send command but thisk
> command never hit to this server but expect keep working good like this
> command hit at server. Maybe I unclear explain, on the code:
>
> /spawn_id_1
> send "put files\r" ;# I'm in ftp protocol and I send command to send file
> expect "350" ;#I recieve code that file successful send
> expect ">" ;#I know that I can work far
> set spawn_id $spawn_id_2
> CHECK files ;#I call function which check is there file where it had to be
> set spawn_id $spawn_id_1
> send "rename file file\r" ;#I send new command which start some process
> here rename file!!!!and here is problem this command there isn't in log
> file but code goes far good way but name of file wasn't be changed
> expect {
> > {
> puts "$expect_out(buffer)" ;#here I see that there isn't send command
> rename, there are only early command
> }
> timeout ....
> }
> set spanw_id $spawn_id_3
> READ ;#code hang up waiting some info from server's logs which inform me
> that name this file was changed, but this name wasn't changed so this
> info never come :(
>
> Fany thing is that order my log's is bad becouse info about reading is
> early than info about buffer, as you see code printing buffer is early
> that procedure READ.
>
> During working this program I observe my log file and I saw that this
> command wasn't send so I invent that couse by buffer /I've read
> somewhere that when buffer is full it won't recieve any information/.
> So I increase match_max and /wow/ it's starting work good. But frankly I
> don't understand this becouse size of match_max is 10000 and there
> wasn't some many characters and although I put:
> expect *
> expect *
> in code, that is I clearing buffer the size of match_max can't be reduce.
>
> I've got extra questions:
> --- does different spawn_is has separate match_max?
>
> I asking becouse I started experiment with something like this:
> spawn_id_1
> match_max 10000
> ..
> ..
> ..
> set spawn_id $spawn_id_2
> match_max 100
>
> and it works too.
>
> But this way is bad in my meaning becouse when I carry my code for other
> server I have to set size of match_max by experiments.
>
> --- does any way to synchronise different spawn_id's? I think I need to
> do this if order in my log's file is wrong.
>
>
> I will be very grateful for explanation this situations. Maybe if you
> havn't got any time to do this maybe you will put some links where
> similar situations is explain the best if it do for examples.
>
> Sinceraly
> Sebastian
>
> PS.
> Sorry for my english. I've been learning it, still.
1) Spawned output is only logged during expect commands, so things may
have occurred in a different order than they appear in the log. To
restate, send commands do NOT add to the log.
2) Yes, the match_max buffer size can be different for each spawned
process. Check the man page for more info.
Don
.
- References:
- 2 question or ask for the links
- From: ms
- Re: 2 question or ask for the links
- From: Don Libes
- Re: 2 question or ask for the links
- From: ms
- Re: 2 question or ask for the links
- From: Don Libes
- Re: 2 question or ask for the links
- From: ms
- 2 question or ask for the links
- Prev by Date: Re: Parrot
- Next by Date: Re: how can i get the file information about time .
- Previous by thread: Re: 2 question or ask for the links
- Next by thread: [OS X Editor] Textmate
- Index(es):
Relevant Pages
|
|