Few minor problems with grid in slide mode
#21
Posted 04 December 2007 - 01:23 AM
Do you maybe have succedd to spot when this problem occur? Having RowExist should prevent any AV from this procedure
Does maybe happen when you modify data inside grid?
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#22
Posted 04 December 2007 - 01:40 AM
#23
Posted 04 December 2007 - 02:03 AM
Unfortunatelly, I still can't spot it. If you may buid me one small sample project maybe this will help me. I am also a little bit confused about in which GridStyle (report or slide) bug appear
I will look at paint bug.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#24
Posted 04 December 2007 - 03:56 PM
AV_test.zip 740.93KB 6 downloads
Try this:
1) Mode - separate thread, rows count - 1000, loop until av - yes. The produce EListError AV, somewhere in ClearRows (see bugreport.txt in project folder)
2) try to play with other modes, recommend to put it into continuous loop and leave for a few hours with ide attached.
Cheers Boki
#25
Posted 04 December 2007 - 08:01 PM
Thank you for your sample. I have played with Exe but not yet spot AV. I will now try with source code too.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#26
Posted 04 December 2007 - 08:23 PM
#27
Posted 04 December 2007 - 08:33 PM
I have test it for about 20 minutes and no AV to jump
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#28
Posted 04 December 2007 - 08:58 PM
I have spot it. This AV is definitelly related to Thread. Most probably application start another thread when previous thread is not finished or something similar.
I will need some time to find how to solve this problem.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#29
Posted 04 December 2007 - 09:15 PM
Yes, definitelly it is related to Threads. It only occur when using Threads in your sample.
Problem most probably occur when in few mseconds, cell is deleted but drawing cell is already started.
Maybe you can try to use some flag, to not update grid until deleting/adding rows is finished? This will most probably help. It will be bad for Grid performance if I put if CellExist(X, Y) on many places and even this doesn't guarantee that cell will exist in next ms
If someone have some suggestion about this issue, I will like to hear
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#30
Posted 04 December 2007 - 09:30 PM
Also i still dont get it, how can grid be repainted while its deleting rows. Is it multi-threaded? But i think, 2 functions for blocking/unblocking any updates is a perfect solution
#31
Posted 04 December 2007 - 09:40 PM
Most probably, because threads are goin to fast, one thread delete row but second thread send message to redraw cells. Also, same happen when you move mouse over cells and grid will try to display hint. While I move mouse for few pixels, cell is already deleted by another thread and when grid try to display hint it come into a empty area.
I will need to do a serious investigations about this, maybe to somehow lock-up grid.
Please note that I will need some time to complete this. I suggest that you try to include some flags in your app, to block executing second thread if one is not finished.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#32
Posted 04 December 2007 - 10:00 PM
#33
Posted 04 December 2007 - 10:26 PM
Yes TTestThread thread. This thread calls DoGridFullUpdate infinitely, but second created thread not wait untill first one finish. You may note that when you click on button only (without Repeat until AV... checkbox checked), all work fine if you don't click on button in few mseconds
I hope that this help you. I will definitelly try to find solution for this situations, but I think that you may prevent this in your application too.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#34
Posted 04 December 2007 - 10:40 PM
One correction. You don't create too many threads, but thread calls DoGridFullUpdate to fast.
I will try now, in your demo to add some flag to prevent this.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#35
Posted 04 December 2007 - 10:53 PM
Edit: exactly
#36
Posted 04 December 2007 - 10:58 PM
I have add corection in post #34. Definitelly, somehow Grid need to be locked while one DoGridFullUpdate is done.
I will need more time to see how this may be solved. I suggest that you try something with using Boolean variable, to prevent new execution of DoGridFullUpdate untill previous one.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#37
Posted 04 December 2007 - 11:05 PM
#38
Posted 04 December 2007 - 11:17 PM
Correctly, it is still same thread but Grid didn't finished with drawing request from operation from previous DoGridFullUpdate and new DoGridFullUpdate is on run and delete cell which is already in drawn process. This is why AV on procedures like GetCellRect, RowVisible, GetRowHeight.
Grid is in separate thread from your thread. I will definitelly need more time to inspect this problem to made grid 100% thread safe.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#39
Posted 04 December 2007 - 11:20 PM
#40
Posted 04 December 2007 - 11:23 PM
- DoGridFullUpdate started
- Rows are cleared
- Rows are added and cells are set
- Drawing procedures of grid are started (we are re-drawing cells)
- We are inspecting Cell's TRect, Cell's text...for example Cell(1, 5);
- DoGridFullUpdate is started again and Rows are cleared again.
- We are finishing drawing for Cell(1, 5), but oops cell is not here!
- AV occur.
I hope that this helps. I will look somehow to add some methods in grid to prevent this situations, maybe Lock procedure or something similar.
Best regards
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users