Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Whenever people agree with me, I always think I must be wrong. -- Oscar Wilde


devel / comp.lang.tcl / Re: My application freezes

SubjectAuthor
* My application freezesLuc
+* My application freezesRalf Fassel
|`- My application freezesRobert Heller
`- My application freezesRich

1
My application freezes

<20221213065631.31c80fe5@lud1.home>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10344&group=comp.lang.tcl#10344

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!aioe.org!GAvf2G0qmUPGymHpCsXiMg.user.46.165.242.75.POSTED!not-for-mail
From: no...@no.no (Luc)
Newsgroups: comp.lang.tcl
Subject: My application freezes
Date: Tue, 13 Dec 2022 06:56:31 -0300
Organization: Aioe.org NNTP Server
Message-ID: <20221213065631.31c80fe5@lud1.home>
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Info: gioia.aioe.org; logging-data="48077"; posting-host="GAvf2G0qmUPGymHpCsXiMg.user.gioia.aioe.org"; mail-complaints-to="abuse@aioe.org";
X-Notice: Filtered by postfilter v. 0.9.2
X-Newsreader: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu)
 by: Luc - Tue, 13 Dec 2022 09:56 UTC

This Tk application uses a while infinite loop. Upon each iteration,
it checks a boolean variable that I can toggle with a key binding.
If the value is 0, the loop continues but does nothing because of
the first line:

if {$::GO == 0} {continue}

The activity stops as expected, but then it becomes unresponsive.
I can't untoggle, I can't do anything.

What is the correct way of doing what I want?

--
Luc
>>

Re: My application freezes

<yga359jppy6.fsf@akutech.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10345&group=comp.lang.tcl#10345

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: ralf...@gmx.de (Ralf Fassel)
Newsgroups: comp.lang.tcl
Subject: Re: My application freezes
Date: Tue, 13 Dec 2022 11:18:09 +0100
Lines: 30
Message-ID: <yga359jppy6.fsf@akutech.de>
References: <20221213065631.31c80fe5@lud1.home>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: individual.net BGLCHNjTmYcJWESCmz1zwAyhxkiY52pdQpGNNQt/fMihCXC/A=
Cancel-Lock: sha1:bS4KSJ7u4GKQDKK8Z/aScG/y8VE= sha1:grOcmdBnkEquQg6Xavwv5rJ4F1I=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
 by: Ralf Fassel - Tue, 13 Dec 2022 10:18 UTC

* Luc <no@no.no>
| This Tk application uses a while infinite loop. Upon each iteration,
| it checks a boolean variable that I can toggle with a key binding.
| If the value is 0, the loop continues but does nothing because of
| the first line:
>
| if {$::GO == 0} {continue}
>
| The activity stops as expected, but then it becomes unresponsive.
| I can't untoggle, I can't do anything.

That's because mouse clicks are handled by the event loop.
Losely spoken, the event loop runs only if there is nothing else to do,
and cleary the above tight loop is "something" to do ;-)

| What is the correct way of doing what I want?

Check 'vwait' or 'tkwait variable' if you want to wait for a variable to
be set while the GUI stays responsive:
https://www.tcl.tk/man/tcl/TclCmd/vwait.html
https://www.tcl.tk/man/tcl/TkCmd/tkwait.html

or 'update' if you need to give the GUI a go during a runnning calculation
https://www.tcl.tk/man/tcl/TclCmd/update.html
(but be aware of
https://wiki.tcl-lang.org/page/Update+considered+harmful
)

HTH
R'

Re: My application freezes

<yxGdnT_51soz5wX-nZ2dnZfqnPqdnZ2d@giganews.com>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10347&group=comp.lang.tcl#10347

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!weretis.net!feeder6.news.weretis.net!1.us.feeder.erje.net!feeder.erje.net!border-1.nntp.ord.giganews.com!nntp.giganews.com!Xl.tags.giganews.com!local-2.nntp.ord.giganews.com!news.giganews.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 13 Dec 2022 13:14:22 +0000
MIME-Version: 1.0
From: hel...@deepsoft.com (Robert Heller)
Organization: Deepwoods Software
X-Newsreader: TkNews 3.0 (1.2.15)
Subject: Re: My application freezes
In-Reply-To: <yga359jppy6.fsf@akutech.de>
References: <20221213065631.31c80fe5@lud1.home>
<yga359jppy6.fsf@akutech.de>
Newsgroups: comp.lang.tcl
Content-Type: text/plain;
charset="us-ascii"
Originator: heller@sharky4.deepsoft.com
Message-ID: <yxGdnT_51soz5wX-nZ2dnZfqnPqdnZ2d@giganews.com>
Date: Tue, 13 Dec 2022 13:14:22 +0000
Lines: 56
X-Usenet-Provider: http://www.giganews.com
X-Trace: sv3-SCyxvZuuO1FpuZMIFt/0OONcvfoGCAPGbZYB+66iiWw4APYC0Czw7+W9kqlfQXMaiUC/Zn0TMj5elaV!y+R2weIosmIMB40lSL2b5+LqIQHoQCWVURkseqWv6EVi4CHyRdSlX7+2jL+eQnzgvsVWVHj7tOb9!RpE=
X-Complaints-To: abuse@giganews.com
X-DMCA-Notifications: http://www.giganews.com/info/dmca.html
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.40
 by: Robert Heller - Tue, 13 Dec 2022 13:14 UTC

At Tue, 13 Dec 2022 11:18:09 +0100 Ralf Fassel <ralfixx@gmx.de> wrote:

>
> * Luc <no@no.no>
> | This Tk application uses a while infinite loop. Upon each iteration,
> | it checks a boolean variable that I can toggle with a key binding.
> | If the value is 0, the loop continues but does nothing because of
> | the first line:
> >
> | if {$::GO == 0} {continue}
> >
> | The activity stops as expected, but then it becomes unresponsive.
> | I can't untoggle, I can't do anything.
>
> That's because mouse clicks are handled by the event loop.
> Losely spoken, the event loop runs only if there is nothing else to do,
> and cleary the above tight loop is "something" to do ;-)
>
> | What is the correct way of doing what I want?
>
> Check 'vwait' or 'tkwait variable' if you want to wait for a variable to
> be set while the GUI stays responsive:
> https://www.tcl.tk/man/tcl/TclCmd/vwait.html
> https://www.tcl.tk/man/tcl/TkCmd/tkwait.html
>
> or 'update' if you need to give the GUI a go during a runnning calculation

Specificly, "update idletasks" should be included in any "loop" in a Tk
application:

while {sometest} {
some processing...
update idle
}

> https://www.tcl.tk/man/tcl/TclCmd/update.html
> (but be aware of
> https://wiki.tcl-lang.org/page/Update+considered+harmful
> )

"update idletasks" is generally "safe". This limits the event loop to
necessary "idle" tasks.

>
> HTH
> R'
>
>

--
Robert Heller -- Cell: 413-658-7953 GV: 978-633-5364
Deepwoods Software -- Custom Software Services
http://www.deepsoft.com/ -- Linux Administration Services
heller@deepsoft.com -- Webhosting Services

Re: My application freezes

<tnaaln$2i9dh$1@dont-email.me>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=10348&group=comp.lang.tcl#10348

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: ric...@example.invalid (Rich)
Newsgroups: comp.lang.tcl
Subject: Re: My application freezes
Date: Tue, 13 Dec 2022 16:53:12 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 22
Message-ID: <tnaaln$2i9dh$1@dont-email.me>
References: <20221213065631.31c80fe5@lud1.home>
Injection-Date: Tue, 13 Dec 2022 16:53:12 -0000 (UTC)
Injection-Info: reader01.eternal-september.org; posting-host="de9cabeb70800ec4c927bcccee0285b0";
logging-data="2696625"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/xBMWqazwuAT6eeIczwJBS"
User-Agent: tin/2.0.1-20111224 ("Achenvoir") (UNIX) (Linux/3.10.17 (x86_64))
Cancel-Lock: sha1:Hri8hwYQZWmwtq3ompqmp4Kx0PM=
 by: Rich - Tue, 13 Dec 2022 16:53 UTC

Luc <no@no.no> wrote:
> This Tk application uses a while infinite loop.

Why? That will block the event loop from running.

> Upon each iteration, it checks a boolean variable that I can toggle
> with a key binding. If the value is 0, the loop continues but does
> nothing because of the first line:
>
> if {$::GO == 0} {continue}
>
> The activity stops as expected, but then it becomes unresponsive.
> I can't untoggle, I can't do anything.

Your description seems reversed. Once the 'infinite loop' starts, then
the UI should become unresponsive.

> What is the correct way of doing what I want?

Tell us what "you want to do" -- then we can answer with better
answers.

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor