Anything special about DELAY PROCESS (Current process;0)?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

Anything special about DELAY PROCESS (Current process;0)?

Jeffrey Kain (Old)
Is there anything "special" about delaying a process for zero ticks, as opposed to IDLE? I remember some talk years ago that calling DELAY PROCESS with 0 ticks was a better way to accomplish the same thing as IDLE, and that it made for smoother multitasking inside of 4D.

Is there any truth to that anymore, or is it more 4D folklore? The docs say that a parameter of zero will resume a delayed process.

Jeff


**********************************************************************
4D v13 is available now - with more than 200 new features to make
your applications richer and faster
http://www.4d.com/products/new.html

4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

RE: Anything special about DELAY PROCESS (Current process;0)?

Stephen J. Orth
Jeff,

I thought JPR mentioned this again during the Summit Pre/Post session.

He reasoning was that Delay Process at least allows the scheduler to break
in, and then route time to another process.  I don't believe IDLE allows
this.

I know we converted all our IDLE calls over to Delay Process with a time
value of zero.


Steve

*********************************************
  Stephen J. Orth                                                
  The Aquila Group, Inc.         Office:  (608) 834-9213
  P.O. Box 690                           Mobile:  (608) 347-6447
  Sun Prairie, WI 53590

  E-Mail:  [hidden email]
*********************************************


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On
Behalf Of Jeffrey Kain
Sent: Thursday, November 07, 2013 10:46 AM
To: 4D iNug Technical ([hidden email])
Subject: Anything special about DELAY PROCESS (Current process;0)?

Is there anything "special" about delaying a process for zero ticks, as
opposed to IDLE? I remember some talk years ago that calling DELAY PROCESS
with 0 ticks was a better way to accomplish the same thing as IDLE, and that
it made for smoother multitasking inside of 4D.

Is there any truth to that anymore, or is it more 4D folklore? The docs say
that a parameter of zero will resume a delayed process.

Jeff


**********************************************************************
4D v13 is available now - with more than 200 new features to make your
applications richer and faster http://www.4d.com/products/new.html

4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************



**********************************************************************
4D v13 is available now - with more than 200 new features to make
your applications richer and faster
http://www.4d.com/products/new.html

4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Anything special about DELAY PROCESS (Current process;0)?

Cannon Smith
In reply to this post by Jeffrey Kain (Old)
Hi Jeff,

I remember switching to this from IDLE when I wanted to force an idle. I think this is why:

"When running compiled or when a long batch task is being executed, 4D might not share the CPU time with other 4D processes. In this situation you would normally use the IDLE command. However, this command does not always execute an idle. 4D's scheduler always checks to see if all processes have used at least one tick of CPU time and then gives control to the next process only when that process used at least one tick. If you need to force an idle, you can execute DELAY PROCESS(Current process;0). This statement will not delay your process but will force an idle. This means that your process will automatically give the control to the next process and will nit use one tick of CPU time."

        -- http://kb.4d.com/assetid=44915

HTH.

--
Cannon Smith
Synergy Farm Solutions Inc.
Hill Spring, AB Canada
403-626-3236
<[hidden email]>
<www.synergyfarmsolutions.com>


On Nov 7, 2013, at 9:46 AM, Jeffrey Kain <[hidden email]> wrote:

> Is there anything "special" about delaying a process for zero ticks, as opposed to IDLE? I remember some talk years ago that calling DELAY PROCESS with 0 ticks was a better way to accomplish the same thing as IDLE, and that it made for smoother multitasking inside of 4D.


**********************************************************************
4D v13 is available now - with more than 200 new features to make
your applications richer and faster
http://www.4d.com/products/new.html

4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
JPR
Reply | Threaded
Open this post in threaded view
|

Re: Anything special about DELAY PROCESS (Current process;0)?

JPR
In reply to this post by Jeffrey Kain (Old)
[JPR]

Steve, Jeff,

I had a chance to discuss this point with LE and LR, and this is the way it works :

Slices of time are allocated to different processes in minimum chunks of 1 tick (1/60th second)

- IDLE is a call to the 4D scheduler, in order to give some time to other processes. If the 1-tick chunk for the current process is not fininsed, the IDLE does nothing. This is done in order to not switch processes too often. So the maximum frequency with which a process will actually call IDLE is 60 times/second, independantly of the frequency of your loops.

- DELAY PROCESS (Current Process; 0) will call the scheduler every time, and just resets the timer for this process. It has no limit on the frequency. If your loop runs at 1 MHz, it will try to call the scheduler 1 miilion times/s.

Exception done of this behavior, the result is never to give time to another process, but to allow the scheduler to decide what he wants to do: call another process, or not.

As always, it depends... In some cases, IDLE is better, or DELAY PROCESS, it just depends of what processes are doing, and the priority you want to give to each.

And also, because of the overhead of these calls compared with the speed of the methods (when optimized) it could be better to call IDLE or DELAY PROCESS  only once for 1,000 or 10,000 loops, in order to get a better global optimization.

My very best,

JPR

On 7 nov. 2013, at 18:02, [hidden email] wrote:

> Subject: RE: Anything special about DELAY PROCESS (Current process;0)?
> Date: Thu, 7 Nov 2013 10:53:39 -0600
> From: "Stephen J. Orth" <[hidden email]>
> To: "'4D iNug Technical'" <[hidden email]>
> Message-ID: <00e001cedbd9$e87f3500$b97d9f00$@the-aquila-group.com>
>
> Jeff,
>
> I thought JPR mentioned this again during the Summit Pre/Post session.
>
> He reasoning was that Delay Process at least allows the scheduler to break
> in, and then route time to another process.  I don't believe IDLE allows
> this.
>
> I know we converted all our IDLE calls over to Delay Process with a time
> value of zero.
>
>
> Steve
>
> *********************************************
>  Stephen J. Orth                                                
>  The Aquila Group, Inc.         Office:  (608) 834-9213
>  P.O. Box 690                           Mobile:  (608) 347-6447
>  Sun Prairie, WI 53590
>
>  E-Mail:  [hidden email]
> *********************************************
>
>
> -----Original Message-----
> From: [hidden email] [mailto:[hidden email]] On
> Behalf Of Jeffrey Kain
> Sent: Thursday, November 07, 2013 10:46 AM
> To: 4D iNug Technical ([hidden email])
> Subject: Anything special about DELAY PROCESS (Current process;0)?
>
> Is there anything "special" about delaying a process for zero ticks, as
> opposed to IDLE? I remember some talk years ago that calling DELAY PROCESS
> with 0 ticks was a better way to accomplish the same thing as IDLE, and that
> it made for smoother multitasking inside of 4D.
>
> Is there any truth to that anymore, or is it more 4D folklore? The docs say
> that a parameter of zero will resume a delayed process.
>
> Jeff


**********************************************************************
4D v13 is available now - with more than 200 new features to make
your applications richer and faster
http://www.4d.com/products/new.html

4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

RE: Anything special about DELAY PROCESS (Current process;0)?

Stephen J. Orth
JPR,

Thank you for taking the time to clarify this...very much appreciated.


Best,


Steve

*********************************************
  Stephen J. Orth                                                
  The Aquila Group, Inc.         Office:  (608) 834-9213
  P.O. Box 690                           Mobile:  (608) 347-6447
  Sun Prairie, WI 53590

  E-Mail:  [hidden email]
*********************************************


-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On
Behalf Of JPR
Sent: Thursday, November 14, 2013 9:32 AM
To: [hidden email]
Subject: Re: Anything special about DELAY PROCESS (Current process;0)?

[JPR]

Steve, Jeff,

I had a chance to discuss this point with LE and LR, and this is the way it
works :

Slices of time are allocated to different processes in minimum chunks of 1
tick (1/60th second)

- IDLE is a call to the 4D scheduler, in order to give some time to other
processes. If the 1-tick chunk for the current process is not fininsed, the
IDLE does nothing. This is done in order to not switch processes too often.
So the maximum frequency with which a process will actually call IDLE is 60
times/second, independantly of the frequency of your loops.

- DELAY PROCESS (Current Process; 0) will call the scheduler every time, and
just resets the timer for this process. It has no limit on the frequency. If
your loop runs at 1 MHz, it will try to call the scheduler 1 miilion
times/s.

Exception done of this behavior, the result is never to give time to another
process, but to allow the scheduler to decide what he wants to do: call
another process, or not.

As always, it depends... In some cases, IDLE is better, or DELAY PROCESS, it
just depends of what processes are doing, and the priority you want to give
to each.

And also, because of the overhead of these calls compared with the speed of
the methods (when optimized) it could be better to call IDLE or DELAY
PROCESS  only once for 1,000 or 10,000 loops, in order to get a better
global optimization.

My very best,

JPR


**********************************************************************
4D v13 is available now - with more than 200 new features to make
your applications richer and faster
http://www.4d.com/products/new.html

4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Anything special about DELAY PROCESS (Current process;0)?

Jeffrey Kain
In reply to this post by JPR
JPR - thanks so much for that clarification!

Jeff




On Thu, Nov 14, 2013 at 10:31 AM, JPR <[hidden email]> wrote:

> [JPR]
>
> Steve, Jeff,
>
> I had a chance to discuss this point with LE and LR, and this is the way
> it works :
>
> Slices of time are allocated to different processes in minimum chunks of 1
> tick (1/60th second)
>
> - IDLE is a call to the 4D scheduler, in order to give some time to other
> processes. If the 1-tick chunk for the current process is not fininsed, the
> IDLE does nothing. This is done in order to not switch processes too often.
> So the maximum frequency with which a process will actually call IDLE is 60
> times/second, independantly of the frequency of your loops.
>
> - DELAY PROCESS (Current Process; 0) will call the scheduler every time,
> and just resets the timer for this process. It has no limit on the
> frequency. If your loop runs at 1 MHz, it will try to call the scheduler 1
> miilion times/s.
>
> Exception done of this behavior, the result is never to give time to
> another process, but to allow the scheduler to decide what he wants to do:
> call another process, or not.
>
> As always, it depends... In some cases, IDLE is better, or DELAY PROCESS,
> it just depends of what processes are doing, and the priority you want to
> give to each.
>
> And also, because of the overhead of these calls compared with the speed
> of the methods (when optimized) it could be better to call IDLE or DELAY
> PROCESS  only once for 1,000 or 10,000 loops, in order to get a better
> global optimization.
>
> My very best,
>
> JPR
>
> On 7 nov. 2013, at 18:02, [hidden email] wrote:
>
> > Subject: RE: Anything special about DELAY PROCESS (Current process;0)?
> > Date: Thu, 7 Nov 2013 10:53:39 -0600
> > From: "Stephen J. Orth" <[hidden email]>
> > To: "'4D iNug Technical'" <[hidden email]>
> > Message-ID: <00e001cedbd9$e87f3500$b97d9f00$@the-aquila-group.com>
> >
> > Jeff,
> >
> > I thought JPR mentioned this again during the Summit Pre/Post session.
> >
> > He reasoning was that Delay Process at least allows the scheduler to
> break
> > in, and then route time to another process.  I don't believe IDLE allows
> > this.
> >
> > I know we converted all our IDLE calls over to Delay Process with a time
> > value of zero.
> >
> >
> > Steve
> >
> > *********************************************
> >  Stephen J. Orth
> >  The Aquila Group, Inc.         Office:  (608) 834-9213
> >  P.O. Box 690                           Mobile:  (608) 347-6447
> >  Sun Prairie, WI 53590
> >
> >  E-Mail:  [hidden email]
> > *********************************************
> >
> >
> > -----Original Message-----
> > From: [hidden email] [mailto:[hidden email]]
> On
> > Behalf Of Jeffrey Kain
> > Sent: Thursday, November 07, 2013 10:46 AM
> > To: 4D iNug Technical ([hidden email])
> > Subject: Anything special about DELAY PROCESS (Current process;0)?
> >
> > Is there anything "special" about delaying a process for zero ticks, as
> > opposed to IDLE? I remember some talk years ago that calling DELAY
> PROCESS
> > with 0 ticks was a better way to accomplish the same thing as IDLE, and
> that
> > it made for smoother multitasking inside of 4D.
> >
> > Is there any truth to that anymore, or is it more 4D folklore? The docs
> say
> > that a parameter of zero will resume a delayed process.
> >
> > Jeff
>
>
> **********************************************************************
> 4D v13 is available now - with more than 200 new features to make
> your applications richer and faster
> http://www.4d.com/products/new.html
>
> 4D Internet Users Group (4D iNUG)
> FAQ:  http://lists.4d.com/faqnug.html
> Archive:  http://lists.4d.com/archives.html
> Options: https://lists.4d.com/mailman/options/4d_tech
> Unsub:  mailto:[hidden email]
> **********************************************************************
>

**********************************************************************
4D v13 is available now - with more than 200 new features to make
your applications richer and faster
http://www.4d.com/products/new.html

4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: RE: Anything special about DELAY PROCESS (Current process;0)?

Tim Nevels
In reply to this post by Jeffrey Kain (Old)
On Nov 14, 2013, at 4:13 PM, Stephen J. Orth wrote:

> JPR,
>
> Thank you for taking the time to clarify this...very much appreciated.

It was a great description of how an internal mechanism of 4D works. Very useful information for performance tuning. I love this kind of information.

Who in this world can pick up the phone and call LR and also get LE on the phone and ask a question about how 4D works. No middle man. No translation. Talk to the actual designers in their native language? And then translate that into easy to understand English?  

I can think of only one… JPR.

It is great to have JPR back again participating on the iNUG.

Tim

********************************************
Tim Nevels
Innovative Solutions
785-749-3444
[hidden email]
********************************************


**********************************************************************
4D v13 is available now - with more than 200 new features to make
your applications richer and faster
http://www.4d.com/products/new.html

4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
Reply | Threaded
Open this post in threaded view
|

Re: Anything special about DELAY PROCESS (Current process;0)?

Max Morrison

On Nov 14, 2013, at 1:52 PM, Tim Nevels wrote:

> On Nov 14, 2013, at 4:13 PM, Stephen J. Orth wrote:
>
>> JPR,
>>
>> Thank you for taking the time to clarify this...very much appreciated.
>
> It was a great description of how an internal mechanism of 4D works. Very useful information for performance tuning. I love this kind of information.
>
> Who in this world can pick up the phone and call LR and also get LE on the phone and ask a question about how 4D works. No middle man. No translation. Talk to the actual designers in their native language? And then translate that into easy to understand English?  
>
> I can think of only one… JPR.

A more compelling endorsement for an internals book, or on-going blog would be hard to come by as concisely.


max



**********************************************************************
4D v13 is available now - with more than 200 new features to make
your applications richer and faster
http://www.4d.com/products/new.html

4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************
JPR
Reply | Threaded
Open this post in threaded view
|

Re: Re: Anything special about DELAY PROCESS (Current process;0)?

JPR
In reply to this post by Jeffrey Kain (Old)
Many thanks, Max, I take it as a great compliment !

Boileau, a french philosopher, said:

        Ce que l'on conçoit bien s'énonce clairement,
        Et les mots pour le dire arrivent aisément.

        (Whatever is well conceived is clearly said,
        And the words to say it flow with ease.)

And also:
        Tout ce qu'on dit de trop est fade et rebutant.
        (That which is repeated too often becomes insipid and tedious.)

http://en.wikiquote.org/wiki/Nicolas_Boileau-Despréaux

My very best,

JPR


On 15 nov. 2013, at 19:55, [hidden email] wrote:

> Subject: Re: Anything special about DELAY PROCESS (Current process;0)?
> Date: Fri, 15 Nov 2013 08:42:09 -0900
> From: Max Morrison <[hidden email]>
> To: 4D iNug Technical <[hidden email]>
> Message-ID: <[hidden email]>
>
>
> On Nov 14, 2013, at 1:52 PM, Tim Nevels wrote:
>
>> On Nov 14, 2013, at 4:13 PM, Stephen J. Orth wrote:
>>
>>> JPR,
>>>
>>> Thank you for taking the time to clarify this...very much appreciated.
>>
>> It was a great description of how an internal mechanism of 4D works. Very useful information for performance tuning. I love this kind of information.
>>
>> Who in this world can pick up the phone and call LR and also get LE on the phone and ask a question about how 4D works. No middle man. No translation. Talk to the actual designers in their native language? And then translate that into easy to understand English?  
>>
>> I can think of only one∑ JPR.
>
> A more compelling endorsement for an internals book, or on-going blog would be hard to come by as concisely.
>
>
> max


**********************************************************************
4D v13 is available now - with more than 200 new features to make
your applications richer and faster
http://www.4d.com/products/new.html

4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[hidden email]
**********************************************************************