in reply to Re^2: Expect spawn_id and threads
in thread Expect spawn_id and threads
s there a way to stop the thread->join from closing all spawn_ids?
I would suspect that there is a thread safety issue where your threads are getting confused as to who "owns" what code. Part of thread safety is to try and isolate objects into their respective threads, so they don't get crossed linked( when a thread is spawned it gets an exact copy of the parent thread at the time of spawning, so you often CANNOT spawn threads at any time, because the new thread will a copy of all of the previously spawned threads). Anyways, since you are not willing to show a code example, we can't spot any obvious mistakes. You might want to try fork-and-exec rather than threads if you are having trouble. See parallel ssh or you might want to try Net::SSH2 which is supposedly thread safe. Also try googling for "perl Net::SSH2 thread safe" and see what others have tried. You may need an pty , see scp progress logging.
The safest way for you to do this may be to spawn your 3 threads right at the start of your program, then pass in the expect ssh stuff in string to be eval'd in each thread, using shared variables.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Expect spawn_id and threads
by lakputcha (Initiate) on Apr 08, 2008 at 08:15 UTC |