Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #6207 > unrolled thread

Would can you do if this happened?

Started byMartin <spam@spam.spam>
First post2013-11-05 13:19 +0000
Last post2013-11-05 06:16 -0800
Articles 5 — 4 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Would can you do if this happened? Martin <spam@spam.spam> - 2013-11-05 13:19 +0000
    Re: Would can you do if this happened? D.J.W. van Kooten <public@ic2remove.this.com> - 2013-11-05 14:36 +0100
      Re: Would can you do if this happened? Martin <spam@spam.spam> - 2013-11-05 14:14 +0000
        Re: Would can you do if this happened? "Wolfgang Riedmann" <wriedmann@gmail.com> - 2013-11-05 15:21 +0100
    Re: Would can you do if this happened? dlzc <dlzc1@cox.net> - 2013-11-05 06:16 -0800

#6207 — Would can you do if this happened?

FromMartin <spam@spam.spam>
Date2013-11-05 13:19 +0000
SubjectWould can you do if this happened?
Message-ID<ff6eu.355146$h62.334170@fx14.fr7>
Hypotheticallly

METHOD Fred1 gets called it takes 2 seconds to run, in the mean time 
Fred1 gets called while it is still running, so things get messy.

The routine calling Fred1 is in a loop, what would stop the loop but 
allow Fred1 to complete?

As above it is a hypothetical question, but I know it can be triggered 
if you put event handing in the wrong place.

I am basically just after increasing my knowleage.

Thanks Martin

[toc] | [next] | [standalone]


#6208

FromD.J.W. van Kooten <public@ic2remove.this.com>
Date2013-11-05 14:36 +0100
Message-ID<6ssh799pkl9v001eu1r3l1vsdelsbekjpi@4ax.com>
In reply to#6207
On Tue, 05 Nov 2013 13:19:13 +0000, Martin <spam@spam.spam> wrote:

Hello Martin,

>METHOD Fred1 gets called it takes 2 seconds to run, in the mean time 
>Fred1 gets called while it is still running, so things get messy.
>
>The routine calling Fred1 is in a loop, what would stop the loop but 
>allow Fred1 to complete?
>
>As above it is a hypothetical question, but I know it can be triggered 
>if you put event handing in the wrong place.
>
Something like this?

CLASS MyMethods
protect lBusy as logic

method Fred1 class MyMethods
if !self:lBusy
  self:lBusy:=true
  // do something
  self:lBusy:=false  // reset busy status
endif

This way you can call Fred1 a 2nd time without running it when the
previous call hasn't reset lBusy. You can add a for..next with retries
and 2 seconds waiting to allow it to run after some delay.

Dick

[toc] | [prev] | [next] | [standalone]


#6210

FromMartin <spam@spam.spam>
Date2013-11-05 14:14 +0000
Message-ID<U27eu.330378$7c4.4665@fx24.fr7>
In reply to#6208
Yes that is a technique I have used before but what do I use as a 
calling slowdown to enable the fred to work? Works well for manual 
clicked on things.

ApplicationExec in the loop?

Would that do?

Thanks

Martin


On 05/11/2013 13:36, D.J.W. van Kooten wrote:
> On Tue, 05 Nov 2013 13:19:13 +0000, Martin <spam@spam.spam> wrote:
>
> Hello Martin,
>
>> METHOD Fred1 gets called it takes 2 seconds to run, in the mean time
>> Fred1 gets called while it is still running, so things get messy.
>>
>> The routine calling Fred1 is in a loop, what would stop the loop but
>> allow Fred1 to complete?
>>
>> As above it is a hypothetical question, but I know it can be triggered
>> if you put event handing in the wrong place.
>>
> Something like this?
>
> CLASS MyMethods
> protect lBusy as logic
>
> method Fred1 class MyMethods
> if !self:lBusy
>    self:lBusy:=true
>    // do something
>    self:lBusy:=false  // reset busy status
> endif
>
> This way you can call Fred1 a 2nd time without running it when the
> previous call hasn't reset lBusy. You can add a for..next with retries
> and 2 seconds waiting to allow it to run after some delay.
>
> Dick
>

[toc] | [prev] | [next] | [standalone]


#6212

From"Wolfgang Riedmann" <wriedmann@gmail.com>
Date2013-11-05 15:21 +0100
Message-ID<bdsd85Fbu9uU1@mid.individual.net>
In reply to#6210
Hi Martin,

> Yes that is a technique I have used before but what do I use as a
> calling slowdown to enable the fred to work? Works well for manual
> clicked on things.
> 
> ApplicationExec in the loop?

exactly

> Would that do?

release computing ressources to the operating system.

Or you could use Sleep() if you like to wait longer, or a predefined
time.

Wolfgang



-- 

[toc] | [prev] | [next] | [standalone]


#6211

Fromdlzc <dlzc1@cox.net>
Date2013-11-05 06:16 -0800
Message-ID<09ef6598-c3e0-4b40-be4d-06066a05d20d@googlegroups.com>
In reply to#6207
Dear Martin:

On Tuesday, November 5, 2013 6:19:13 AM UTC-7, Martin wrote:
> Hypotheticallly
> 
> METHOD Fred1 gets called it takes 2 seconds to
> run, in the mean time Fred1 gets called while
> it is still running, so things get messy.
> 
> The routine calling Fred1 is in a loop, what
> would stop the loop but allow Fred1 to complete?
> 
> As above it is a hypothetical question, but I
> know it can be triggered if you put event
> handing in the wrong place.
> 
> I am basically just after increasing my knowleage.

Just like with any business...

Call Freds_boss, who notes the required information, and posts the priority (or date time) and necessary information.  Bosses don't do work (long involved tasks), so there is no lockup while lots of work is done.  They are extremely interruptable most times.

Fred1 asks Freds_boss what the next job is, when Fred1 is complete with the current task.  Alternatively, Fred1 could post statistics on completed jobs.

David A. Smith

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web