Hi Massimo, Ok we are getting somewhere.
I started a TCL thread, which loads my lib, create a session and starts it, followed by a vwait forever. This worked. I see the readycmd procedure been called when all the c++ code is happy. It is not that easy to explain so here is what I do in the RivetChildInit: set tid [thread::create] thread::send -async $tid { proc ::readycmd {} { puts [info commands] puts [namespace children ::] puts [info procs] } proc ::errorcmd {txt} { log ERROR "SB: $err" } # Opening the link if {[catch {load -global libThreadTclApi.so threadtclapi} err]} { puts "Error loading the libThreadTclApi.so library: $err" } # Creating a session set ::sess_ [ynet new] $::sess_ configure -daemon y1 -port 2002 $::sess_ configure -readycmd ::readycmd $::sess_ configure -errorcmd ::errorcmd $::sess_ open vwait forever } This code works but still 2 things is happening: 1) If the proc readycmd is defined outside the thread's script, the library is not be able to call it and generates an error. 2) on the rvt page, I can't see the ::sess_ variable nor that I see my library's new command. So the there is still things not working as I was hoping they will. Thank you, Brice.