* Phillip Brooks <
[email protected]>
| The main thing you have to be sure of is that if you do create an
| interpreter, it must run in the same thread that created it and it
| must be destroyed in the same thread that created it. Since you say
| you are using interfaces that don't require an interpreter, I think
| you are safe. If you want to use an interpreter, you can do that, but
| you just have to keep track of the thread to interpreter relationship.
I think in that case (using an interp in a second thread) I would go the
script level thread creation anyway, where you get it all "for free".
My use case is asynchronous reading data from Tcl_Channels (sockets)
which are created in main thread and transferred to the new thread via Tcl_CutChannel/Tcl_SpliceChannel (the reading must take place regardless
of whether the main thread is blocked somehow, so fileevents are not an option). The thread-specific data structs which are used to manage the Tcl_Channels behind the scenes are initialized as required by TCL - a
really Good Thing¹.
TNX
R'
---
¹
http://www.catb.org/jargon/html/G/Good-Thing.html
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)