View Issue Details

IDProjectCategoryView StatusLast Update
0008457ADK-Xojo-V4RBPerformancepublic2019-01-12 07:20
ReporterIvan SmahinAssigned ToIvan Smahin 
Status resolvedResolutionfixed 
Product Version 
Target Version9.0.xFixed in Version9.0.x 
Summary0008457: "App not responding" for long-running Valentina calls
DescriptionActually reported by Beatrix Willius.

Since updating my app to 64bit it can handle larger amounts of data. Unfortunately, this means that "not responding" now also shows up when adding data.

Try the example "Field_FromToFile" and use it with a larger file - I have done this with a nice 300 MB file. That adding the data to a database takes 2 seconds or so isn't bad. But I can see the the app as "not responding".

Whenever an operation with Valentina takes longer (diagnosis, deleting data, checking the journal file) I still see the "not responding" - always.

I seem to remember that Ruslan said this should be improved. But I can't see this anywhere.

Wasn't this supposed to be improved for diagnosis? This never worked for me. Didn't I do an example??? Need to dig. However, all Valentina operations need to leave the application responsive.
TagsNo tags attached.


Ivan Smahin

Ivan Smahin

2019-01-11 08:22

manager   ~0010637

Last edited: 2019-01-12 07:17

View 2 revisions

Beatrix noted that even with Xojo threads some calls like db.Diagnose still cause "app not responding".
After few days of testing and thinking we come to following:

1. You should run Xojo thread from some Xojo control handler, but you must not waiting there for thread finish! If you do so, it is practically the same as a plain execution approach, because "app event loop" is get stuck until the end of the current handler call. So, you should leave the handler as soon as possible.
2. To react on the Xojo thread finish you should use the Timer object. BTW, there is no "joined" Xojo threads and it seems it is because of reason above.
3. We misunderstood Xojo threads and how REALYieldToRB() should be called from the plugin, so we built some ugly solution, calling Valentina in dedicated thread and looping REALYieldToRB() in the main thread.
4. Instead, now we are calling Xojo's _UnsafeAttachCurrentThread/_UnsafeDetachCurrentThread right in the V4RB plugin.
5. Each V4RB method (actually it is for potentially hard/long methods) creates YieldRunner stack object before Valentina call. Now, everything is in the V4RB code only.
6. There are modified V4RB examples - API_way/Database_Diagnose and API_way/Field_FromToFile to demonstrate correct implementation for long-running Valentina calls.

Issue History

Date Modified Username Field Change
2019-01-11 08:22 Ivan Smahin New Issue
2019-01-11 08:22 Ivan Smahin Status new => assigned
2019-01-11 08:22 Ivan Smahin Assigned To => Ivan Smahin
2019-01-11 08:22 Ivan Smahin Note Added: 0010637
2019-01-12 07:17 Ivan Smahin Note Edited: 0010637 View Revisions
2019-01-12 07:20 Ivan Smahin Status assigned => resolved
2019-01-12 07:20 Ivan Smahin Fixed in Version => 9.0.x
2019-01-12 07:20 Ivan Smahin Resolution open => fixed