Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Feature Requests

Reply
 
Thread Tools Display Modes
Old 10-09-2017, 09:26 AM   #1
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default ReaScript GFX/defer: 60 FPS Refresh Rate

Hi !

Current FPS refreshing rate of GFX window are 32/33 fps (hz). Nice for relatively fix graphics (usual GUI).

For smooth display of moving elements, having 60 fps would be nice.

This will make scripts like my ReaTab Hero way smoother and nice to look at.

Of course, if it can go even higher (120hz... ?) it will be even better but the benefit will be less important. 60 FPS allows smooth displacement of shapes on most screen already.

Thanks for listening !

EDIT 2020-01-15
Resume of our dicussion

Quote:
Originally Posted by tack
So just to aggregate all our ideas into one place (and to cheekily bump the thread at a time when hopefully Justin or schwa are watching):

Proposal: introduce a read-write variable to ReaScriptAPI called gfx.refresh_rate (gfx_refresh_rate for EEL) which controls the script's GFX window updates.

The value MUST affect the frequency of defer() calls in addition to GFX update rate.
The value SHOULD be dynamically adjustable. This allows scripts to temporarily increase refresh rates (e.g. during a transient animation or user interaction) or even to decrease rates as a means of self-throttling.
Negative values MAY imply fractional values, so e.g. -3 means 1/3 (or 1 refresh every 3 seconds). Alternatively, to allow for greater precision, negative values could indicate tenths of a second, so a value of -15 means 10/15 (or 1 refresh every 1.5 seconds).
The value SHOULD have some reasonable upper bound (e.g. 100)


(#3 is a MAY because scripts can already self-throttle easily enough. Yes, defer is still called, but a simple callback that checks current time is so cheap that it's scarcely worth the effort of avoiding.)

Last edited by X-Raym; 11-19-2023 at 01:27 AM.
X-Raym is offline   Reply With Quote
Old 10-09-2017, 10:43 AM   #2
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

See "stretch marker guard", I did smooth GUI changes by constant switch of blitbuffer id nd alpha channel. Sort of workaround.
mpl is offline   Reply With Quote
Old 10-09-2017, 11:01 AM   #3
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

@mpl
Does it allows more than 33Fps ?

Even the most basic GFX loop (simple black window) is 33 Fps...

ReaScripts-Templates/X-Raym_GFX FPS.lua at master · ReaTeam/ReaScripts-Templates

For fast moving elements like ReaTab, 60Fps is the only way to make it smooth, I can see that by comparing with other softwares.
X-Raym is offline   Reply With Quote
Old 10-09-2017, 12:41 PM   #4
mpl
Human being with feelings
 
mpl's Avatar
 
Join Date: Oct 2013
Location: Moscow, Russia
Posts: 3,984
Default

I think it is common limitation of ReaScript made for better performance. So the request maybe is to have ability change refresh rate for defer ().
mpl is offline   Reply With Quote
Old 10-09-2017, 01:19 PM   #5
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

Yep, it is the same for simple defer scripts.

My point is that extending it to 60 fps allows smooth fast movement on GFX interface, which may be a valuable reason to request higher ReaScript speed :P
X-Raym is offline   Reply With Quote
Old 10-10-2017, 08:04 AM   #6
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 4,175
Default

+1

Scrolling the strips in LBX Stripper is noticeable jerky @ ~30fps. Everytime I move them I wish for a faster refresh (as well as for other non gfx benefits of doing so).
__________________
Projects - Reascripts - Lua:
Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner
Donate via Paypal | LBX Tools Website
lb0 is offline   Reply With Quote
Old 01-09-2020, 06:08 AM   #7
BirdBird
Human being with feelings
 
BirdBird's Avatar
 
Join Date: Mar 2019
Posts: 428
Default

Huge +1

Reviving this thread back from the dead. So many windows and hotkeys I use in REAPER are amazing third party defer scripts. It is sad to see them operate at 30 FPS, it feels clunky.
BirdBird is offline   Reply With Quote
Old 01-09-2020, 08:34 PM   #8
SubbaseDnB
Human being with feelings
 
Join Date: May 2017
Posts: 454
Default

i will give this a +1 too
SubbaseDnB is offline   Reply With Quote
Old 01-09-2020, 11:41 PM   #9
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,770
Default

Quote:
Originally Posted by X-Raym View Post
My point is that extending it to 60 fps allows smooth fast movement on GFX interface, which may be a valuable reason to request higher ReaScript speed :P
Supposedly not.

As the GUI thread needs to have a lower priority than all audio threads, defining a higher refresh rate in many cases will not be able to be met by the CPU, resulting in stuttering GUI and lower GUI performance.
OTOH higher refresh rate will create more thread switching and hence more "unproductive" CPU overhead and hence hamper the audio performance.

-Michael
mschnell is offline   Reply With Quote
Old 01-10-2020, 12:00 AM   #10
Klangfarben
Human being with feelings
 
Join Date: Jul 2016
Location: Los Angeles, CA
Posts: 1,701
Default

Quote:
Originally Posted by mschnell View Post
Supposedly not.

As the GUI thread needs to have a lower priority than all audio threads, defining a higher refresh rate in many cases will not be able to be met by the CPU, resulting in stuttering GUI and lower GUI performance.
OTOH higher refresh rate will create more thread switching and hence more "unproductive" CPU overhead and hence hamper the audio performance.
Pretty doubtful. Even at 60fps, the script would have to be doing a pretty massive amount of graphic manipulation to have any effect whatsoever on the audio performance. I have yet to see a script that would do that. We're talking about basic things like smoother scrolling here, not video editing or 3D rendering.
Klangfarben is offline   Reply With Quote
Old 01-10-2020, 02:39 AM   #11
BirdBird
Human being with feelings
 
BirdBird's Avatar
 
Join Date: Mar 2019
Posts: 428
Default

Quote:
Originally Posted by mschnell View Post
Supposedly not.

As the GUI thread needs to have a lower priority than all audio threads, defining a higher refresh rate in many cases will not be able to be met by the CPU, resulting in stuttering GUI and lower GUI performance.
OTOH higher refresh rate will create more thread switching and hence more "unproductive" CPU overhead and hence hamper the audio performance.

-Michael
So far no script has even came close to the amount of CPU overhead that basic actions like scrolling/zooming/opening the MIDI editor have for me. My guess is the tiny bit of extra CPU usage from scripts running at a faster rate would be peanuts in comparison.
BirdBird is offline   Reply With Quote
Old 01-10-2020, 03:52 AM   #12
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,770
Default

You might have hundreds of script active at the same time and you might want to watch their GUI while playback or rendering.

-Michael
mschnell is offline   Reply With Quote
Old 01-10-2020, 04:18 AM   #13
BirdBird
Human being with feelings
 
BirdBird's Avatar
 
Join Date: Mar 2019
Posts: 428
Default

Quote:
Originally Posted by mschnell View Post
You might have hundreds of script active at the same time and you might want to watch their GUI while playback or rendering.

-Michael
Like with everything else in REAPER, it would ideally be a setting. If you don't need it, don't use it. I personally keep track of all the background scripts I use and I would only benefit from a faster clock for defer scripts.
I sometimes show cool third party scripts in REAPER to other people and almost always the framerate bothers them, it's 2019, we are all used to smooth 60fps.
BirdBird is offline   Reply With Quote
Old 01-10-2020, 04:33 AM   #14
mschnell
Human being with feelings
 
mschnell's Avatar
 
Join Date: Jun 2013
Location: Krefeld, Germany
Posts: 14,770
Default

Quote:
Originally Posted by BirdBird View Post
it's 2019.
No
mschnell is offline   Reply With Quote
Old 01-10-2020, 04:37 AM   #15
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

Maybe few scripts needs 60 fps, but for those which need it (especially those with moving graphics), it can be game changer :P
X-Raym is offline   Reply With Quote
Old 01-10-2020, 04:39 AM   #16
BirdBird
Human being with feelings
 
BirdBird's Avatar
 
Join Date: Mar 2019
Posts: 428
Default

Quote:
Originally Posted by mschnell View Post
No
Ooops
BirdBird is offline   Reply With Quote
Old 01-13-2020, 08:31 AM   #17
kf.
Human being with feelings
 
Join Date: Jan 2020
Location: daw limbo
Posts: 5
Default

As a new user coming from other DAWs and using scripts to bring in features that I love, it's definitely jarring to have them respond in a slow and jerky way vs all other UI elements.

60fps scripts would be amazing
kf. is offline   Reply With Quote
Old 01-13-2020, 09:07 AM   #18
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: Southern Vermont
Posts: 864
Default

This new generation doesn't know how good they have it... Complaining about not having 60 cycle-per-second GUI/defer rates for their scripts.

I remember way back when:

I would have to stick my 1 kilobyte floppy-disc into a toaster oven just to play Tetris. 640x480. That $#&@ was fire, too.
__________________

Support my feature request!
Dafarkias is offline   Reply With Quote
Old 01-13-2020, 09:08 AM   #19
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: Southern Vermont
Posts: 864
Default

Jk!

+1
__________________

Support my feature request!
Dafarkias is offline   Reply With Quote
Old 01-13-2020, 09:16 AM   #20
Klangfarben
Human being with feelings
 
Join Date: Jul 2016
Location: Los Angeles, CA
Posts: 1,701
Default

Yes, I think part of the basic issue is that as a Reaper user, like it or not, you are heavily dependent on scripts. In fact, I'm not sure Reaper would be usable for me without them. So, when they are treated like second class citizens it really affects your entire workflow as several of those scripts are going to be constantly running (Heda's Track Inspector, lb0's LBX Stripper and Smart Knobs, Sexan's Pro Tools Playlists and soon-to-be finished Area Selection, Tack's Reaticulate etc.)

I have a feeling from reading many posts that GUI issues in scripts are just not something the developers are really worried about since not many scripts make use of anything very complicated GUI-wise. But I think it really is hurting the overall development of Reaper, especially when scripters run into things like the GUI not refreshing fast enough. That's just not something that should happen in this day and age with the available tools IMHO.
Klangfarben is offline   Reply With Quote
Old 01-13-2020, 09:32 AM   #21
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,066
Default

I second that Klangfarben. I'm pretty much using the same scripts as you do and I would even say that we are not alone here. These scripts augment Reaper by a HUGE amount. I also wouldn't have jumped on the Reaper bandwagon wasn't it for the API and available scripts. They literally enable you to create the DAW for your own needs.

I see it like that: the API was created so that the community can add whatever new functionality is needed. Which is absolutely great, amazing move by Justin and schwa and sooo much appreciated. Also, this makes Reaper really unique. No other DAW features this kind of level of integration.

Long story short: 60 fps would be absolutely fantastic for all gfx needs, like area selection, Julian's MIDI tools, etc...
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom

Last edited by _Stevie_; 01-13-2020 at 09:51 AM.
_Stevie_ is offline   Reply With Quote
Old 01-13-2020, 01:04 PM   #22
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: Southern Vermont
Posts: 864
Default

Not to be a devil's advocate, but isn't it actually already insane the capabilities that the API already possesses? (especially when combined with SWS & JS extension)

To me, it's pretty radical that a DAW software provides its own GUI functions in an API, period.

If a scripter really wanted, they could also program their script as a c++ extension. The refresh rates would (probably?) be better then. But you'd probably have to include a GUI library or build your own.

I'm spit-balling here, this isn't really my area of technical expertise. You get what you pay for, right? The API is pretty good for a software that cost $60.

Maybe the donationware scripters could start a kick-starter campaign for Justin and Schwa to incorporate a list of the most needed improvements to the API.

I'd pitch in another $60
__________________

Support my feature request!
Dafarkias is offline   Reply With Quote
Old 01-13-2020, 01:27 PM   #23
Klangfarben
Human being with feelings
 
Join Date: Jul 2016
Location: Los Angeles, CA
Posts: 1,701
Default

Quote:
Originally Posted by Dafarkias View Post
Not to be a devil's advocate, but isn't it actually already insane the capabilities that the API already possesses? (especially when combined with SWS & JS extension)

To me, it's pretty radical that a DAW software provides its own GUI functions in an API, period.

If a scripter really wanted, they could also program their script as a c++ extension. The refresh rates would (probably?) be better then. But you'd probably have to include a GUI library or build your own.

I'm spit-balling here, this isn't really my area of technical expertise. You get what you pay for, right? The API is pretty good for a software that cost $60.

Maybe the donationware scripters could start a kick-starter campaign for Justin and Schwa to incorporate a list of the most needed improvements to the API.
Dude, it's a feature request, not a kickstarter. That's not how Reaper works. That's not how any DAW works. The scripters are out there making Reaper a better product, most of them making little or no money off of it. When a bunch of people chime in for a Script or API request it's usually because it is much needed and there aren't suitable workarounds. And if you are concerned about compensation for Justin and Schwa you can always shell out for a commercial license instead
Klangfarben is offline   Reply With Quote
Old 01-13-2020, 01:38 PM   #24
Dafarkias
Human being with feelings
 
Dafarkias's Avatar
 
Join Date: Feb 2019
Location: Southern Vermont
Posts: 864
Default

True dat.

Put it in the stack of thousand-odd other amazing feature requests that haven't been reciprocated over the years.

Lol

But for what it's worth, 60-cycle defer would be nice...
__________________

Support my feature request!
Dafarkias is offline   Reply With Quote
Old 01-13-2020, 03:22 PM   #25
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

@Dafarkias
No one is telling reaper or bad or that scripting isnt good in it as it is.

I just faced a simple issue with one of my script.
I cant fix it myself cause it is a limitation so I report.
Theb it is up to dev to evaluate.
Maybe it is a very simple fix with no side effects. Cool, my script will be awesome, and writting this FR would have worth it :P
Maybe it is a complex fix which need rewritting core aspects of the software. In this case, considering the usage amount that it will have, be sure it will be discarded by devs. Thats ok, we have plenty of other things to play with :P
X-Raym is offline   Reply With Quote
Old 01-13-2020, 08:06 PM   #26
Xenakios
Human being with feelings
 
Xenakios's Avatar
 
Join Date: Feb 2007
Location: Oulu, Finland
Posts: 8,062
Default

It would be useful to benchmark first if the problem is actually because of the defer calls timer frequency.

If the script defer functions do too much work, upping the update speed wouldn't help anything, it would just make things worse, because Reaper would be calling the heavy functions more often.

A resourceful C++ developer could probably figure out the ID of the defer timer and raise the update frequency. My prediction is that it wouldn't help the scripts that have GUI update problems at the moment, but it still would be a useful thing to test.

edit : Looks like the script defer timer is the same one (ID 666) that is used to update the play cursor position etc. It is possible to make an extension plugin that changes the speed of that, but because it is used for other things too besides deferred ReaScripts, it might lead to some complications. So probably not a good idea...Maybe best to just hope the Cockos developers make the ReaScript timer a separate one with a user adjustable speed.
__________________
I am no longer part of the REAPER community. Please don't contact me with any REAPER-related issues.

Last edited by Xenakios; 01-14-2020 at 06:16 AM.
Xenakios is offline   Reply With Quote
Old 01-14-2020, 11:23 AM   #27
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,628
Default

I have thought about that for quite some time and I think it would be nice to have something like the gfx.ext_retina:

Code:
   gfx.refresh_rate
which is set to 30 by default and can be set to higher, or even lower.

Means, Reaper could know, how often per second to run the deferred script(even if it's only approximate), and do the scheduling of scripts based on it.

Though I don't know, how often Reaper's Gui itself refreshes. I think, it's only 30fps in the first place, so this would mean big overhaul on that one. Especially, as GPU-support for the GUI-part is an old request.

But nevertheless: the above approach could make it compatible with old scripts while giving new ways of limiting the need for ressources, just to make scripts run as often as needed.
And bringing it up to a refresh-rate needed by the user, maybe even more than 60fps for hardcore power-users.


Edit:
Another thought: negative values mean "run only every x seconds", so I can set it to -3 and it will run the defer-loops only every three seconds.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...

Last edited by Meo-Ada Mespotine; 01-14-2020 at 12:11 PM.
Meo-Ada Mespotine is offline   Reply With Quote
Old 01-14-2020, 11:52 AM   #28
Klangfarben
Human being with feelings
 
Join Date: Jul 2016
Location: Los Angeles, CA
Posts: 1,701
Default

+1 for Mespotine's suggestion above. That is a really elegant way of handling it if the Devs can do it.
Klangfarben is offline   Reply With Quote
Old 01-14-2020, 11:56 AM   #29
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,066
Default

Woah, that's such a brilliant idea Mespo! Totally supporting that one.

This would also mean that we can set scripts, that don't need a high refresh rate, to a lower value and therefore save some CPU.
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 01-14-2020, 12:01 PM   #30
tack
Human being with feelings
 
tack's Avatar
 
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,619
Default

This would be great! And it should be dynamic as well, so e.g. I can bump up the refresh rate during some sort of animation or active user interaction, and lower it when the script is otherwise idle.

Last edited by tack; 01-14-2020 at 01:23 PM.
tack is offline   Reply With Quote
Old 01-14-2020, 12:05 PM   #31
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,628
Default

Quote:
Originally Posted by tack View Post
This would be great! And it should be dynamic as well, so e.g. I can bump up the refresh rate during some sort of animation or active user inaction, and lower it when the script is otherwise idle.
Yes, exactly. And if I only need to run my script once per second, it would need only 1/30th of ressources+some overhead on Reaper's side for the scheduling-management.

And an occasional bump possible with this isn't something I have thought about, but it would be awesome as well to have that kind of control
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 01-14-2020, 01:13 PM   #32
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,066
Default

Well, that would be even more brilliant, lol.
Not sure how much housekeeping such a monitoring would need?
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Old 01-14-2020, 04:37 PM   #33
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

We know only need an answer from the devs :P
X-Raym is offline   Reply With Quote
Old 01-14-2020, 06:54 PM   #34
cool
Human being with feelings
 
Join Date: Dec 2017
Location: Sunny Siberian Islands
Posts: 962
Default

Yes! +1
cool is offline   Reply With Quote
Old 01-15-2020, 08:15 AM   #35
tack
Human being with feelings
 
tack's Avatar
 
Join Date: Jan 2014
Location: Ontario, Canada
Posts: 1,619
Default

So just to aggregate all our ideas into one place (and to cheekily bump the thread at a time when hopefully Justin or schwa are watching):

Proposal: introduce a read-write variable to ReaScriptAPI called gfx.refresh_rate (gfx_refresh_rate for EEL) which controls the script's GFX window updates.
  1. The value MUST affect the frequency of defer() calls in addition to GFX update rate.
  2. The value SHOULD be dynamically adjustable. This allows scripts to temporarily increase refresh rates (e.g. during a transient animation or user interaction) or even to decrease rates as a means of self-throttling.
  3. Negative values MAY imply fractional values, so e.g. -3 means 1/3 (or 1 refresh every 3 seconds). Alternatively, to allow for greater precision, negative values could indicate tenths of a second, so a value of -15 means 10/15 (or 1 refresh every 1.5 seconds).
  4. The value SHOULD have some reasonable upper bound (e.g. 100)

(#3 is a MAY because scripts can already self-throttle easily enough. Yes, defer is still called, but a simple callback that checks current time is so cheap that it's scarcely worth the effort of avoiding.)
tack is offline   Reply With Quote
Old 01-15-2020, 08:23 AM   #36
X-Raym
Human being with feelings
 
X-Raym's Avatar
 
Join Date: Apr 2013
Location: France
Posts: 9,900
Default

@tack
That sounds good. I ported this resume in first post.
X-Raym is offline   Reply With Quote
Old 01-21-2020, 02:08 PM   #37
lb0
Human being with feelings
 
Join Date: Apr 2014
Posts: 4,175
Default

Yes - would still love to be able to have more control over this - even if I break things with it

Tack's breakdown would work for me.

Finally I scraped the cash together to upgrade to v6 (releasing just before Xmas meant I'd have to wait) - nothing in v6 so far to excite me - but wanted to support the devs as it seems like forever ago I paid for v4!

However - I would like my $60 upgrade to go towards this functionality - yeah - i know it doesn't work like this - but worth a try...
__________________
Projects - Reascripts - Lua:
Smart Knobs 2 | LBX Stripper | LBX Floating FX Positioner
Donate via Paypal | LBX Tools Website
lb0 is offline   Reply With Quote
Old 02-01-2020, 02:17 PM   #38
BirdBird
Human being with feelings
 
BirdBird's Avatar
 
Join Date: Mar 2019
Posts: 428
Default

I really like mespotine's solution as well.



(this is definitely not a bump)
BirdBird is offline   Reply With Quote
Old 02-02-2020, 10:38 AM   #39
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,628
Default

Just for completion: some more thoughts on my idea and what could be potentially problematic with it for scripters.

The current behavior is the following(afaik):
Every deferred-script will be scheduled in the order of being started.
That means, if defer-script1 has been started first and defer-script2 has been started second and defer-script3 as third one, this order will remain.
That means, you can be sure, that every defer-cycle will be:

defer-script1
defer-script2
defer-script3

You can code upon this assumption. So if defer-script1 sets an extstate and defer-script3 reads this extstate, you can be sure that the extstate will be set first and read after that. So communication between defer-script1 and defer-script3 can be designed once and will work.

Now, my attempt could change that order. If you run the defer-script3 twice as often, the order could be:

defer-script1
defer-script3
defer-script2
defer-script3

This can lead to so called "Race Conditions". So if the defer-script3 expects the extstate set before being run, this will not be the case.
In fact, the extstate is set by defer-script1 only once in the example above, because it is run only once per "schedule-cycle".
But if defer-script3 expects it to be updated every time, it will only get a new extstate only every second defer-cycle of defer-script3, as defer-script3 is run twice in the example above.

More on the topic of Race Condition can be found here: https://en.wikipedia.org/wiki/Race_condition

So if the devs add my approach, you need to be very careful if your script is dependent on outputs/extstates/etc of another defer-script running at the same time.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 02-11-2020, 08:36 AM   #40
_Stevie_
Human being with feelings
 
_Stevie_'s Avatar
 
Join Date: Oct 2017
Location: Black Forest
Posts: 5,066
Default

This definitely is a bump
__________________
My Reascripts forum thread | My Reascripts on GitHub
If you like or use my scripts, please support the Ukraine: Ukraine Crisis Relief Fund | DirectRelief | Save The Children | Razom
_Stevie_ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 11:38 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.