|
From: Selverian, J. <Joh...@sy...> - 2016-04-15 19:49:49
|
I use something like this after I start my threads:
firstLoop = true;
anyThreadsRunning = false;
while (true)
{
totalRunsCompleted = numAcceptedRuns = 0.0;
anyThreadsRunning = false;
for ( FXint i = 0 ; i < totalNumCombiThreadsRunning ; i++ )
{
if ( comboRunsThread[i].running() ) {
anyThreadsRunning = true;
}
totalRunsCompleted += comboRunsThread[i].getTotalRunsCompleted();
numAcceptedRuns += comboRunsThread[i].getNumAcceptedRuns();
}
// if all threads are finished
if ( !anyThreadsRunning ) {
break;
} else {
if ( firstLoop ) {
setButtons();
firstLoop = false;
}
progressBar->setProgress((FXint) (totalRunsCompleted * 100.0 / largestNumRuns));
tmpStr.format("%d", numAcceptedRuns);
acceptedDesigns_LBL->setText(tmpStr);
if ( getApp()->peekEvent() ) {
getApp()->runWhileEvents();
}
}
} // while (true)
-----Original Message-----
From: Martin Preuss [mailto:ma...@aq...]
Sent: Friday, April 15, 2016 2:22 PM
To: fox...@li...
Subject: [Foxgui-users] FOX and Multithreading
Hi,
I'm using FOX 1.6.
If I remember correctly, FOX functions must only be called from within the main thread. However, I want a worker thread to prepare some data which needs then to be displayed as soon as it's ready (and convenient for the main thread).
Can someone please hint me as to how data can safely be transported from a side thread to the main thread?
Thanks and
Regards
Martin
--
"Things are only impossible until they're not"
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager Applications Manager provides deep performance insights into multiple tiers of your business applications. It resolves application problems quickly and reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Foxgui-users mailing list
Fox...@li...
https://lists.sourceforge.net/lists/listinfo/foxgui-users
|