1. Beatrix Willius
  2. Valentina Database ADK
  3. Sonntag, Juni 03 2018, 09:36 AM
  4.  Abonnieren via E-Mail
Wanted to test the multithreaded diagnosis. But I still can see the pizza-of-death when doing a diagnosis that is in a thread. Do I need to change anything?

Xojo 2017r3, macOS 10.13.6 (latest beta)

What exactly does this mean from the release notes?
[New] db.Diagnose() now works in multi-thread way if logging while diagnosing disabled

Regards

Beatrix Willius
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
To avoid pizza-of-death you should call "diagnose" in separate Xojo "thread" - do you?
Special for Xojo (cooperative "threads" there) we do diagnose and reindex calling REALYieldToRB() every 50ms.

Currently, there are 2 things which allow vKernel run db.diagnose as multi-threading algorithm:
1. Last arg (inFile) in Database_Diagnose is NULL. So diagnose produces boolean result only - no report.
2. System db's property "DiagnoseMTFlag" is "true" (default state). You can change it if needed, but keep in mind that this is not schema-storable property, so you should change it each time after db.Open.
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
Thanks for the answer, but this doesn't change anything.

Calling code is:


dim theDiagnoser as new DiagnoseThread(theDatabase, Silent)
theDiagnoser.Run

while not DiagnoseFinished or theDiagnoser.State = Thread.Running
app.SleepCurrentThread 100
wend



The action event of the diagnosis thread:


if theDatabase.Diagnose(EVVerboseLevel.kLow, Nil) then


Any other ideas?

Regards

Beatrix Willius
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
Not sure, seems we have a db_diagnose example - can you try it with your db?
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
Found the problem. First I thought that other stuff could interfere like a progress window or the dock tile animation. Then I remembered that I have a troubleshooting menu item called "Open to diagnosis". This does what it says and does only open plus the diagnosis. This feature doesn't show the pizza-of-death. But this means that when I have a database open with a few cursors then the multi-threaded diagnosis doesn't work. Bug or feature? In the latter case the multi-threaded diagnosis wouldn't be a good benefit.

Regards

Beatrix Willius
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
Hi guys,

please tell me how to use multi-threaded diagnosis on a database that has cursors open. I was so looking forward to the multi-threaded diagnosis and I really really want to use it.

Regards

Beatrix Willius
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
"MultiThreaded diagnose" means vKernel's internal multithreaded algorithm (see my comments above). You can turn it OFF if needed, but it is ON by default. The purpose is to speed up the diagnose (our tests shows ~3-4 times faster against old "plain" algorithm). Actually, you should do nothing special. Just something like "bool_res = db.Diagnose(null)"
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
Hi Ivan,

I have tried "bool_res = db.Diagnose(null)" . It works in the example. It doesn't work in my app. The only difference I can think of is that my app has open cursors. When I use the functionality "Open to diagnosis" in my app which in principle works like your example the multi-threaded diagnosis also works. So my code is okay.

What do I need to do in my app to get this working?

Regards

Beatrix Willius
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
Please clarify - what do you mean by " It doesn't work in my app"?
What do you see and what do you expect?
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
Hi Ivan,

I did the changes in code that were explained a bit above.

1. When I have a database open with cursors and do a multi-threaded diagnosis I get the pizza of death and the diagnosis is running rather slowly.

2. When I do the example with my database the MT diagnosis works fine (fast and no pizza). When I do "open to diagnosis" in my app which only opens a database and does a diagnosis the MT diagnosis also works fine (fast and no pizza).

Regards

Beatrix Willius
Kommentar
There are no comments made yet.
Ivan Smahin Akzeptierte Antwort
It seems we are talking about Xojo specific cooperative threads approach, so you are calling db.Diagnose in separate Xojo thread to get UI more responsive (avoiding "pizza death";). Could you modify our example to reproduce your issue? I don't understand how it could be if vKernel calls "RB yield" function every 50ms during diagnose.
Kommentar
There are no comments made yet.
Beatrix Willius Akzeptierte Antwort
I will try.

Regards

Beatrix Willius
Kommentar
There are no comments made yet.
  • Seite :
  • 1


There are no replies made for this post yet.
However, you are not allowed to reply to this post.

Categories

Announcements & News
  1. 0 subcategories
Valentina Studio
  1. 2 subcategories
Valentina Server
  1. 4 subcategories
Valentina Database ADK
  1. 0 subcategories
Valentina Reports ADK
  1. 0 subcategories
Other Discussions
  1. 2 subcategories
BETA Testing
  1. 0 subcategories
Education & Research
  1. 0 subcategories