Re: Design question: C command calling back into Tcl
- From: bob findlay <fcsoft@xxxxxxxxxxxxx>
- Date: Wed, 15 Jun 2005 09:49:30 -0400
Why not split your application into two halves. The Tcl/Tk process for
displaying and triggering the data. The C process half for doing the
capture.
To connect those two I would suggest a straightforward messaging scheme
such as shared memory (as used by the SIMPL project at
https://sourceforge.net/projects/simpl)
bob
Helmut Giese wrote:
> Hello out there,
> I have the following requirements:
> - From a Tcl script I invoke a command written in C.
> - This command produces lots of data.
> - I would like to receive each of these data items at the moment it is
> produced.
>
> My idea was to use the concept of linked variables:
> - The C code puts the data into a C variable which is linked to a Tcl
> variable and then calls Tcl_UpdateLinkedVar.
> - The respective Tcl variable has a write trace which, when activated,
> will get the current data item and store it somewhere else (since it
> will be overwritten from the C side when the next item arrives).
>
> Is this approach feasible? I am asking, because I get mysterious
> crashes. Maybe this whole concept is wrong. What happens is
> - Tcl interpreter calls C command
> - C command calls Tcl_UpdateLinkedVar which triggers a trace in the
> same interpreter.
>
> This is some sort of recursion involving the same interpreter. Can
> this be made to work or is this design just plainly wrong?
> Any insight is greatly appreciated.
> Best regards
> Helmut Giese
.
- Follow-Ups:
- Re: Design question: C command calling back into Tcl
- From: Helmut Giese
- Re: Design question: C command calling back into Tcl
- References:
- Design question: C command calling back into Tcl
- From: Helmut Giese
- Design question: C command calling back into Tcl
- Prev by Date: Re: Looking for a starting point with distributed DB's
- Next by Date: Re: WINDOWS200: Detecting the default web browser
- Previous by thread: Design question: C command calling back into Tcl
- Next by thread: Re: Design question: C command calling back into Tcl
- Index(es):
Relevant Pages
|
Loading