multithreading - How do I write an asynchronous C extension to Tcl? -


I have a C function that I would like to make available to Tcl. The thing is, I want to make calls from TCL asynchronous in the same fashion: Thread :: Send, ie? -Sync? And? Vernamus? Flags

I do not asynchronous C API understanding of TCL, and how to use it it can not find any examples. The C, I can create a thread to work, but do not know how to handle how the signal to set the variable specified by Warnm place in the thread how to signal when it is finished, and Tcl command is.

For this problem, I use another process would not be able to use a simple asynchronous solution TCL side, such as a pipe, TCL threads, or library that COM. The reason for this is that C call loads are allocated in a large data structure, and other C calls that come in front of TCL (which is out of necessity) that the structure was allocated in the same thread as Tcl Interp. .

Any assistance will be highly appreciated.

Write the easiest way C code is synchronous with a simple API, and client data structures, associated with orders or an interpreter to all states if possible, or failing to use thread-specific data call to then use the thread package, other threads these utility Threads Allow for, and wrap that creates inside the TCL code The API looks natural and that (lightly) hides how you go about implementing APIs. Which is very easy to do.

You can also use TCL because the thread package is actually only one wrapper. (It communicates by sending events between actually threads; see the definition in the thread package for a burstful description.) Or, if you are actually doing I / O only, then you write your code to asynchronous I / O and Failivent / access to use Notifier system to work to work just simple ways above and Tcl code and existing packages Rather than are more complex.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -