View previous topic :: View next topic |
Author |
Message |
Jens Andenaes
Joined: 29 Apr 2005 Posts: 19
|
Posted: Sat Jun 18, 2005 1:10 pm Post subject: Strange behaviour, plot freezing 20 seconds |
|
|
I have a strange problem with my application which has 5 plot boxes with 3 plots in each box updated in real time. The plots take about 0.2 seconds to complete and are updated each second. If I click on the window control bar while DPlotJr is busy doing its job and moves the window then the whole process hangs for exactly 20 seconds. The same thing happens if I open another window from the main application while DPlotJr is busy but then it will hang until I close the window and then start again on the next multiple of 20 seconds after freezing up. Everything works fine as long as I dont do anything while DPlotJr is busy.
Any ideas??
Jens |
|
Back to top |
|
|
DPlotAdmin Site Admin
Joined: 24 Jun 2003 Posts: 2310 Location: Vicksburg, Mississippi
|
Posted: Sat Jun 18, 2005 9:07 pm Post subject: |
|
|
Jens,
I haven't had time to test this myself, but you mentioning 20 seconds leads me to believe that there's a problem with how DPLOTLIB.DLL communicates with DPlot - or at least a problem with how I thought it should work. The timeout value for all calls is 20 seconds. I would have thought this meant that the DDEML would continuously try to communicate with DPlot for 20 seconds, but that is apparently not what is happening. It sounds more like it tries once, then waits 20 seconds before returning control to your program... which doesn't make much sense.
I'll let you know what I find out when I return from my road trip and have a bit more time. You may be forced to disable DPlot while doing frequent plot updates, but I'd rather find a better solution. _________________ Visualize Your Data
support@dplot.com |
|
Back to top |
|
|
Jens Andenaes
Joined: 29 Apr 2005 Posts: 19
|
Posted: Sun Jun 19, 2005 8:51 am Post subject: |
|
|
Hi David,
Your hunch matches my observations very well, the delay would be 0.2s if everything is ok, then 20.2s, 40.2 or 60.2 seconds from my testing.
Jens |
|
Back to top |
|
|
Jens Andenaes
Joined: 29 Apr 2005 Posts: 19
|
Posted: Sat Jul 23, 2005 12:49 pm Post subject: |
|
|
David,
I just downloaded version 2.0.03 and tested the 20 sec freeze which seems to be there still. I didnt see any mention of this being fixed in the release notes so I assume this problem is still there. Am I right?
Jens |
|
Back to top |
|
|
DPlotAdmin Site Admin
Joined: 24 Jun 2003 Posts: 2310 Location: Vicksburg, Mississippi
|
Posted: Sat Jul 23, 2005 4:52 pm Post subject: |
|
|
Jens,
That's correct, nothing is changed yet - at least not in dplot.exe. Another user had a similar problem: he was flooding DPlot with requests for bitmaps of plots, and DPLOTLIB.DLL was losing its mind about which document was associated with which bitmap. The end result was that DPLOTLIB.DLL failed to close documents after retrieving a bitmap (which it should have done) and this user was, in a short time, getting an error due to too many open documents.
The new version of DPLOTLIB.DLL (available either with the DPlot Jr distribution or from http://www.dplot.com/lib/dplotlib.zip) will solve the problem but in a way that might not be all that swell in your case. All of the DPlot_Plot and similar functions will now fail if the caller has already called one of these but the function has not yet returned. A better solution will (in the next iteration) be to offer an asynchronous option - in other words, DPLOTLIB.DLL functions won't return control to the caller until they're done, rather than the current scheme which returns immediately after sending data to DPlot and fails after 20 seconds. It will likely be sometime next week before this is available as I'll want to test it fairly thoroughly; I'll let you know when it is available. _________________ Visualize Your Data
support@dplot.com |
|
Back to top |
|
|
Jens Andenaes
Joined: 29 Apr 2005 Posts: 19
|
Posted: Thu Feb 16, 2006 1:48 pm Post subject: |
|
|
Hi David,
I am just back on this project and noticed that this problem is there with the latest version downloaded today. Any revised schedule for fixing the problem?? |
|
Back to top |
|
|
DPlotAdmin Site Admin
Joined: 24 Jun 2003 Posts: 2310 Location: Vicksburg, Mississippi
|
Posted: Thu Feb 16, 2006 5:05 pm Post subject: |
|
|
Jens,
I'm not having any (bad) luck duplicating this problem. Is there any chance you can send me a copy of your program? _________________ Visualize Your Data
support@dplot.com |
|
Back to top |
|
|
adamp
Joined: 16 May 2006 Posts: 2
|
Posted: Tue May 16, 2006 5:12 pm Post subject: |
|
|
Jens, David,
I met with the same problem in my application. I regenerated this behavior as below:
1. Under mouse event (for example MouseUp) I call DPlot_Plot8 and DPlot_GetBitmapEx.
2. I paint received bitmap in my application (in MouseEvent scope).
3. Fast mouse clicking leads to our behavior.
Of course during fast mouse clicking system calls with high frequency my MouseUp handler from where we calls DPlot_xxx functions. I think Jens, that you should avoid "concurrent" calling of DPlot_xxx functions. I suppose that dplotlib.dll cannot service next DDE transaction when previous one is in progress (David, please correct me). Alternatively maybe dplotlib.dll code cannot be called concurrently.
Jens, I checked simple resolution: please secure your code (calling of DPlot_xxx) with busy semaphore. Set this semaphore just before calling of DPlot_xxx function, and reset - when you finished... Return without calling DPlot_xxx if you have semaphore in set state.
I hope, that it will help. |
|
Back to top |
|
|
DPlotAdmin Site Admin
Joined: 24 Jun 2003 Posts: 2310 Location: Vicksburg, Mississippi
|
Posted: Tue May 16, 2006 9:24 pm Post subject: |
|
|
Quote: | I suppose that dplotlib.dll cannot service next DDE transaction when previous one is in progress (David, please correct me). |
The problem is actually in DPlot, not the DLL. But your point is essentially correct. You'll want to avoid calling DPlot_Plot/DPlot_GetBitmap, etc., until a previous call returns. _________________ Visualize Your Data
support@dplot.com |
|
Back to top |
|
|
|