Re: starkit-lite and threads: can't package require

"Pat Thoyts" <[email protected]> Mon, 16 Jul 2007 22:33:22 +0100
Newsgroups gmane.comp.lang.tcl.starkit
Message-ID <[email protected]>
On 16/07/07, Uwe Koloska <[email protected]> wrote:
>
> Hello again,
>
> On 12 Jul., 13:55, Uwe Koloska <[email protected]> wrote:
> > I vaguely remember some discussion, but don't remember where and with what
> > subject, that the initialization code for interpreters is flawed in
> > tclkit-lite.  Is there a fix or someone working at it?  Where do I have to
> > start, to make a fix myself?
>
> I have found this discussion:  It is an old thread on this list
> starting on 2007-01-02 with the subject "starpack vfs can't be
> accessed from thread".  But the fix that is presented by Jeff Hobbs
> ist already included in the boot.tcl and the provided threadvfs
> procedure that starts a new thread with the vfs mounted doesn't work
> -- maybe because it was not meant for a starkit-lite without a proper
> mk4 database engine.
>
> What I understand now, ist that it is by intention, that a thread has
> not the same vfs mount then the main thread.
>
> But what is the recommended way to load a package inside a thread?
>
> The only reason I have to use threads (yes, I know the discussion
> about threads, being evil ;-) is a c-based package (fluidsynth, if you
> care) that uses threads, because callbacks from this thread create big
> troubles, if they used to trigger Tk functions -- but this is another
> story and told inside another discussion ;-)

There are some issues still with the initial startup code. Its been a
while but if I remember correctly I found the internal packages were
not always available in slave interpreters and this is likely the same
in thread interpreters. I currently use a modified kitInit.c as
attached. This drops the preInitScript in favour of using the full
appInit script as was done in the old tclkits. Possibly this will help
you -- seems to work ok for me.
Pat Thoyts