No such thing as a small change | |
PerlMonks |
Re^4: Program Design Around Threadsby aeaton1843 (Acolyte) |
on Mar 06, 2013 at 21:21 UTC ( [id://1022094]=note: print w/replies, xml ) | Need Help?? |
That's just it though. This isn't true: "Each thread it using a different file, so no conflicts or ordering problems arise. No need for locking or semaphores or synchronisation." There are as many threads running as there are machines and commands. For Example: tid1 -> machine1 -> "show running-config" takes 30 seconds to get reply. tid2 -> machine2 -> "show running-config" takes 30 seconds to get reply tid3 -> machine1 -> "show vlan" takes 5 seconds to get reply. tid4 -> machine2 -> "show vlan" takes 5 seconds to get reply. Since tid 3&4 finish first, my 2 output files now have show vlan at the top instead of show running-config because those threads finished before thread 1&2 and wrote contents into file machine1.txt and machine2.txt. Maybe I am missing something?
In Section
Seekers of Perl Wisdom
|
|