Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion How to interrupt a task which is running in a thread?

Received: by 10.66.79.233 with SMTP id m9mr74635pax.37.1348664859944;
        Wed, 26 Sep 2012 06:07:39 -0700 (PDT)
Path: a8ni23577473pbd.1!nntp.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post01.iad.highwinds-media.com!fed15.iad.POSTED!not-for-mail
From: "Gerald W. Lester" <Gerald.Les...@KnG-Consulting.net>
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:15.0) Gecko/20120907 Thunderbird/15.0.1
MIME-Version: 1.0
Newsgroups: comp.lang.tcl
Subject: Re: How to interrupt a task which is running in a thread?
References: <9045bde7-7f2c-4b82-8fb0-5a58f7292e2c@googlegroups.com> <ebf74d5b-354b-46ad-aa1f-029195ef9a50@googlegroups.com> <6d22b55d-1ad3-4416-8efb-e17cb0e07984@googlegroups.com> <28755aad-11e0-4c8d-b752-7c4f000dce40@googlegroups.com>
In-Reply-To: <28755aad-11e0-4c8d-b752-7c4f000dce40@googlegroups.com>
Lines: 17
Message-ID: <v6D8s.200186$lE.181057@fed15.iad>
X-Complaints-To: abuse@usenetserver.com
NNTP-Posting-Date: Wed, 26 Sep 2012 13:07:39 UTC
Organization: UseNetServer - www.usenetserver.com
Date: Wed, 26 Sep 2012 08:07:39 -0500
X-Received-Bytes: 2075
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

On 9/26/12 4:56 AM, Andy wrote:
> Hi Arjen
>
> Thanks for your reply.
> I have a Tk GUI app. There are "Start" and "Stop" buttons on my GUI. After pressing "Start" button, my app will execute a command in a thread, maybe copy a large file. It will take a long time. At the moment, I want to press "Stop" button to stop this action immidiately. And then, I can press "Start" button to copy that file again. This is what I want. Do you have any idea? Or is there another way to achieve this?

First off, no need to use threads here at all.

Tcl/Tk event driven model will handle it.  Take a look at the help/man pages 
for the fcopy command.  To stop the transfer, just close both files in the 
procedure invoked by the "Stop" button.

-- 
+------------------------------------------------------------------------+
| Gerald W. Lester, President, KNG Consulting LLC                        |
| Email: Gerald.Les...@kng-consulting.net                                |
+------------------------------------------------------------------------+