As of 8.4.14, there is a chicken-and-egg problem with threads and the starpack vfs.
Threads now must explicitly mount any vfs's that they wish to use, as the mounts are no longer implicilty shared. In order for a thread to mount a vfs, it must package require the appropriate vfs package. However in the case of a starpack, the package needed to mount the starpack's vfs (vfs::mk4) is in the starpack itself.
The following files built into a starpack demonstrate the problem.
=======
file: test.vfs/main.tcl
package require starkit
starkit::startup
package require Thread
set foo [file join [info nameofexecutable] foo.tcl]
source $foo
set t [thread::create {thread::wait}]
# thread::send $t { #what goes here to give the thread access foo.tcl located in the starpack's vfs" }
thread::send $t [list source $foo]
=======
file: test.vfs/foo.tcl
puts "hello world from [thread::id]"
|