Quantcast
Channel: Xojo Programming Forum - Latest topics
Viewing all articles
Browse latest Browse all 3780

Freezing (project included) catch 22 when trying to load (and run) an array of TimerMBS over a limit

$
0
0

Ok thought I would post this now as I have been round in circles trying to over come this!

I have attached an example project below reproducing the problem. I have only tested this on Windows.

I am trying to load TimerMBS’s into some arrays, but over a certain limit, the app seems to freeze after it has successfully loaded them into the arrays. what will work with my example 140 timers, then will not with for example with double that. though result do vary for time to time.

What seems odd to me is that it has no problem with loading them into the arrays, its just what happens after that… it just freezes. It will even run all the timers without a problem after adding to them to the the arrays (so its not the amount of running timers as far as I can tell - though you can tell me off for this many - I am building a MIDI app with different device ports - so need lot it it can manage it).
But it will still freeze in either case - if you comment out the line that enabled the timers it still crashes after putting them into the array. Loading (/ running) less timers will not cause it to freeze. But as i said this issue doesn’t seem to be actually loading them or running them as it does that fine, its just what happens after it with the ui.

if I use a thread most of the time it doesn’t freeze the interface, but then the timers wont fire. Which is probably expected behaviour? Though I am not sure, I am in no way wanting to update the gui.

I’ve tried using separate script to fire the timers using another timer to check the state of the thread (which is probably expected not to work) but whatever I have tried I can’t seem to come up with a way round this limitation.

Is my attached project there debug log you can see what is happening at each stage
The buttons:

  • “Add 2 x 70 Timers To Arrays and Run Timers” - Works
  • “Add 4 x 70 Timers To Arrays and Run Timers” - Freeze after loading array - will still fire the timers. But will freeze even if you don’t fire the timers. Though. I have realised since if you press button 4 first then press clear arrays - it actually works?
  • “Add 2 x 70 Timers To Arrays Using Thread And Run” - Loads into arrays. Does not freeze. But does not fire timers,
  • Add 4 x 68 Timers To Arrays Using Thread And Run - loads into arrays and does not freeze (unlike 2), but does not fire timers.

is there any way to have best of both worlds where it does not freeze and will load many timers into the arrays (and fire them)? Or am I asking simply asking for too much from an app here? or possible just generally get it more crash proof?
test_timerMBSArrays.zip (7.1 KB)

Thanks! Using version 2024 1.1

5 posts - 3 participants

Read full topic


Viewing all articles
Browse latest Browse all 3780

Trending Articles