Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

how do I do this ?
I want to run two programs ( one foreground, and one background) that can
read / change the same variable ( a [list] ) .  THe background program
will keep the list updated, while the forground redisplays it when a
change is detected.

Can I do that using namespace ?


Report this thread to moderator Post Follow-up to this message
Old Post
Mitch
02-24-05 09:01 PM


Re: how do I do this ?
Mitch wrote:

> I want to run two programs ( one foreground, and one background) that
> can
> read / change the same variable ( a [list] ) .

What do you mean by 'program'? Is it Tcl Script or standalone
executable application?

--
Pozdrawiam (Greetings)!
Googie

Report this thread to moderator Post Follow-up to this message
Old Post
Googie
02-25-05 01:59 AM


Re: how do I do this ?
sorry to be so vague..

I want to run a Tcl script ,
that will run another tcl script in the background to keep a
buffer ( the [list] ) updated.

...M'


Googie wrote:
> Mitch wrote:
>
> 
>
>
> What do you mean by 'program'? Is it Tcl Script or standalone
> executable application?
>


Report this thread to moderator Post Follow-up to this message
Old Post
Mitch
02-25-05 01:59 AM


Re: how do I do this ?
Since you have 2 seperate process running you will need some type of
inter-process communication mechanism.  When I do this I have one
program write to a file and the other program reads the file.  If there
is a change then take action.

Another method is to open a pipe between the 2 programs, or use the
comm package in TCLLIB.

Also, I have stopped calling my TCL programs "scripts".  I have noticed
that many people (managment types and even some engineers) think of
scripts as being trivial programs.


Report this thread to moderator Post Follow-up to this message
Old Post
bbeacham@desanasystems.com
02-25-05 01:59 AM


Re: how do I do this ?
I need one program to update the variable in another one, can I use namespac
e to share
that varname ?
( and ditto about the "script" word, never to be used in mixed company! )

...M

bbeacham@desanasystems.com wrote:
> Since you have 2 seperate process running you will need some type of
> inter-process communication mechanism.  When I do this I have one
> program write to a file and the other program reads the file.  If there
> is a change then take action.
>
> Another method is to open a pipe between the 2 programs, or use the
> comm package in TCLLIB.
>
> Also, I have stopped calling my TCL programs "scripts".  I have noticed
> that many people (managment types and even some engineers) think of
> scripts as being trivial programs.
>


Report this thread to moderator Post Follow-up to this message
Old Post
Mitch
02-25-05 01:59 AM


Re: how do I do this ?
"Mitch" <uqrudev@houston.rr.com> wrote in message
news:TEqTd.43017$cW2.40808@fe2.texas.rr.com...
> I need one program to update the variable in another one, can I use
namespace to share
> that varname ?
>     ( and ditto about the "script" word, never to be used in mixed
company! )
>
> ...M
Nope. Separate Tcl programs cannot share variables.

If you truely need separate programs I suggest you make them communicate by
2 way pipes or sockets. Both methods are relatively easy in Tcl.

But perhaps you can solve your issue with 1 program. Folks here
will help if you explain in more detail. For example, what is the
"background"
program doing while it's not updating the list?

Roy
>
> bbeacham@desanasystems.com wrote: 
>



Report this thread to moderator Post Follow-up to this message
Old Post
Roy Terry
02-25-05 01:59 AM


Re: how do I do this ?
I'll gladly elaborate.

My program displays and edits the data from a multichannel data set.

think of it
as a line graph of a sound wave.
(Actually between 15 to 50 channels simultaneously)

Each channel of data is stored as a textfile of integers, one value per line
typical files are 900,000 lines long, but could be much larger.
(now multiply that 900,000 scans by 15 channels, that is my basic data set !
)

The User can use provided controls to zoom and "browse" up and down the grap
hs,
which are displayed as "line" objects on canvas widgets. A typical canvas wo
uld be
perhaps 900x75 (xy) in size.

I currently load up the whole banana, I load all the data in all the channel
s
into a tcl [list] which consists of a list of sublists, each sublist containing al
l the
data for one channel. (a list of lists) .
Then based on User input, I grab the part of the list that needs to be displ
ayed and
redraw the linegraph on the canvas.

When I first wrote the program , the data sets were much smaller and all wen
t well.
But now , the program has gotten popular , been distributed on 3 continents 
(oil field)
and now getting used on HUGE data sets that I never expected or tested for.

The result is that it A) eats up ALOT of RAM and B) the big [list] is clumsy.
Changing its contents (like after an edit) take a considerable time. As does
 getting an
lrange of data to display.

I am trying to find an alternative way to move quickly through the
data for zoom and browse operations.


My primary goal is to speed up the display and minimize RAM.

...Mitch







Roy Terry wrote:
> "Mitch" <uqrudev@houston.rr.com> wrote in message
> news:TEqTd.43017$cW2.40808@fe2.texas.rr.com...
> 
>
> namespace to share
> 
>
> company! )
> 
>
> Nope. Separate Tcl programs cannot share variables.
>
> If you truely need separate programs I suggest you make them communicate b
y
> 2 way pipes or sockets. Both methods are relatively easy in Tcl.
>
> But perhaps you can solve your issue with 1 program. Folks here
> will help if you explain in more detail. For example, what is the
> "background"
> program doing while it's not updating the list?
>
> Roy
> 
>
>


Report this thread to moderator Post Follow-up to this message
Old Post
Mitch
02-25-05 01:59 AM


Re: how do I do this ?
Tcl does also have threads, if they are compiled in, which can be made
to share variables, or data.

--
David N. Welton
- http://www.dedasys.com/davidw/

Apache, Linux, Tcl Consulting
- http://www.dedasys.com/

Report this thread to moderator Post Follow-up to this message
Old Post
David N. Welton
02-25-05 01:59 AM


Re: how do I do this ?
Mitch wrote:

> I'll gladly elaborate.
>
> My program displays and edits the data from a multichannel data set.
>
> think of it
>   as a line graph of a sound wave.
> (Actually between 15 to 50 channels simultaneously)
>
>       Each channel of data is stored as a textfile of integers, one value
>       per line
> typical files are 900,000 lines long, but could be much larger.
> (now multiply that 900,000 scans by 15 channels, that is my basic data set
> !)
>
>       The User can use provided controls to zoom and "browse" up and down
>       the graphs,
>   which are displayed as "line" objects on canvas widgets. A typical
>   canvas would be
> perhaps 900x75 (xy) in size.
>
>       I currently load up the whole banana, I load all the data in all the
>       channels
> into a tcl [list] which consists of a list of sublists, each sublist
> containing all the data for one channel. (a list of lists) .
>        Then based on User input, I grab the part of the list that needs to
>        be displayed and
> redraw the linegraph on the canvas.
>
>   When I first wrote the program , the data sets were much smaller and all
>   went well.
> But now , the program has gotten popular , been distributed on 3
> continents (oil field) and now getting used on HUGE data sets that I never
> expected or tested for.
>
>        The result is that it A) eats up ALOT of RAM and B) the big [list]
>        is clumsy.
> Changing its contents (like after an edit) take a considerable time. As
> does getting an lrange of data to display.
>
>         I am trying to find an alternative way to move quickly through the
> data for zoom and browse operations.
>
>
> My primary goal is to speed up the display and minimize RAM.
>
> ...Mitch
>
If you are interested in speeding up your application, you should really
download and use the BLT exentension for TCL/TK.

This extension provides several additional widgets for TK, including a very
nice graph widget which has all that good zooming stuff built into it.
Additionally, you can load your data into BLT's vector object instead of a
list. This will allow you to store your data into memory using a binary
format.

You should also be able to remove a lot of TCL code whose functionality can
be replaced by the BLT graph widget.


Report this thread to moderator Post Follow-up to this message
Old Post
Dennis LaBelle
02-25-05 01:59 AM


Re: how do I do this ?
hmmmmm, major code change, but sounds very interesting, I'll take a look.
....M'


Dennis LaBelle wrote:
> Mitch wrote:
>
> 
>
> If you are interested in speeding up your application, you should really
> download and use the BLT exentension for TCL/TK.
>
> This extension provides several additional widgets for TK, including a ver
y
> nice graph widget which has all that good zooming stuff built into it.
> Additionally, you can load your data into BLT's vector object instead of a
> list. This will allow you to store your data into memory using a binary
> format.
>
> You should also be able to remove a lot of TCL code whose functionality ca
n
> be replaced by the BLT graph widget.
>


Report this thread to moderator Post Follow-up to this message
Old Post
Mitch
02-25-05 01:59 AM


Sponsored Links




Last Thread Next Thread Next
Pages (2): [1] 2 »
Search this forum -> 
Post New Thread

Tcl archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 07:51 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.