title: TCL: thread::send command is running in main thread instead of thread id mentioned in send command
body: <p>Below is the example script written for implementing multi threading for my existing single (main thread) threaded scripts.</p>
  
  <pre><code># Wrapper proc for executing passed procedure list
  proc eval_procs {dut_no procList} {
  telnet_dut $dut_no ;# proc to change telnet id to $dut_no
  puts "thread id: [thread::id]"
  foreach procedure [join [list $procList]] {
      eval [join $procedure]
    }
  }
  
  for {set i 0} {$i &lt;= 1} {incr i} {            
  lappend jointhreadIds [thread::create]            
  }
  
  set dutList [list 1 2]
  set dutConfigList [list [list "get_port_statistics_mt 1"] [list "c_get_port_statistics_mt 2"]] ;#proc for getting port statistics from switch 1 and 2
  
  for {set i 0} {$i &lt;= 1} {incr i} {            
  thread::send -async [lindex $jointhreadIds $i] [eval_procs [lindex $dutList $i] [lindex $dutConfigList $i]]             
  }
  </code></pre>
  
  <p>Two threads are created for calling the same proc (eval_procs) for each switch. But, when the proc is called using the thread::send -async, this proc is called sequentially for switch1 and later for switch2. After printing thread::id in eval_procs, I found that these procs are running in main thread, which is the reason for sequential run.</p>
  
  <p>Any one to help me here, what mistake I am doing here or any other procedure to follow ?</p>
  
  <p>The below post mentions to define the procs in the script while creating thread, but for me I have so many already developed libraries (procs) which are working fine with main thread. So, I can not move all the libraries under the thread::create.</p>
  
  <p><a href="https://stackoverflow.com/a/32154589/13100284">https://stackoverflow.com/a/32154589/13100284</a></p>