On 2018-12-20 13:21-0800 Alan W. Irwin wrote:
On 2018-12-20 18:56-0000 António Rodrigues Tomé wrote:
Hi Alan
I do not completely understand the need of using a mutex in the qt driver
however
without any change in the actual driver approach it is easy to allow the
driver to work well within a qt app and also in any other c or c++ program
if in the file qt.cpp function bool initQtApp( bool isGUI )
we add after the ++appCounter; line (line 90)
the instruction
if(appCounter == 1 && qApp != NULL) ++appCounter;
this will prevent the call
delete qApp;
when one closes the driver within a qt application, that would crash teh
application, and it does not conflict with the actual behavior of the qt
driver it onnly takes account for the fact that there is a qApp that was
not started by the driver.
Hi António:
[...]
So from the point of view of a non-expert for this code, I would
suggest if you think the mutex is no longer needed because of your
change, then go ahead an remove it to see whether that combined change
passes all tests you care to make including ideally running the
comprehensive test script as documented in
doc/wiki_source/Testing_PLplot.
With regard to the mutex, I have included what Alban initially said about
it way back when.
From his comment my guess is the mutex is a necessity to keep the Qt
components of PLplot thread-safe because the PLplot core is not thread
safe (although fixing that bad state of affairs is on our long-term agenda).
And subsequently there was a whole lot of plplot-devel traffic about
properly setting up that mutex with no question from anyone about its
necessity.
Anyhow, forget my naive idea above that you might want to drop the mutex.
Alan
---------- Forwarded message ----------
Date: Fri, 20 Mar 2009 17:00:49 +0000
From: Alban Rochel <a.roc...@imperial.ac.uk>
To: Alan W. Irwin <ir...@beluga.phys.uvic.ca>
Subject: Qt driver update
Alan,
I've made a break from QSAS for an hour and I've made a couple of improvements
to the Qt driver.
- I've introduced a mutex to make some parts thread-safe (I haven't checked if
all the driver was).
- Someone noticed that when 2 qtwidgets were running on 2 streams, closing them
didn't close the driver properly. This should be fixed by now. When qApp is
run, all the qtwidgets created before are tagged as being run, and so the
driver shouldn't try to run one qApp per widget.
Cheers,
Alban
__________________________
Alan W. Irwin
Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________
Linux-powered Science
__________________________
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel