For Programmers: Free Programming Magazines  


Home > Archive > Tcl > October 2006 > -async send in thread









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author -async send in thread
Torsten Edler

2006-10-22, 7:05 pm

Thanks, Mark - that was it! It was beginning to drive me nuts.

I am using the activestate distro for Windows - the help contains only
the C level interface to the thread library procedures which is not
much help at tcl level. The latest man pages i could find were for
version 2.4 (ftp://ftp.tcl.tk/pub/tcl/thread) - they specify
--------------------------------------------------------------
thread::send id ?-async? script ?varname?
-------------------------------------------------------------
Obviously wrong or changed between 2.6.3 and 2.4. Anybody any ideas
where to get recent man pages?

Gerald W. Lester

2006-10-23, 7:03 pm

Torsten Edler wrote:
>
> Hi Mark,
>
> synchronize (better backup) a directory structure to a different drive,
> basically traverse a directory tree: for each directory found recurse,
> for each file found check if file does not exist at destination drive
> (directory) or has a different mtime, if so copy it. As this is a time
> consuming task i wanted to use threads: the worker that does the
> directory processing and the master that has the GUI. The master sends
> name of source and destination directory to worker when "GO" button is
> pressed. Worker sends back a message to master whenever a directory is
> entered or finished, a file is copied or new directory created. The GUI
> maintains a text widget that logs basically the progress (messages from
> worker).
>
> Currently i have a non-threaded script that works. I guess if i don't
> split it into two threads the GUI freezes all over until all the work
> is done (update idletasks makes no difference). I experimented a little
> with "after" to start the directory processing but that did not help -
> as it shares CPU with GUI. So i started looking for threads to see if i
> might get it to work. First step was to use a worker for just copying
> the files but that did not help,


If that was the problem, you would not need threads. The fcopy with the
-command option would have solved your problem.

> i guess the directory work is the CPU
> hog tha makes GUI sluggish.


Are you burning 100% CPU cycles are waiting on network I/O for the directory
listing?

Remember -- always know your problem before attempting to solve it.


--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com