Home » U++ Library support » U++ MT-multithreading and servers » Can't use MT to capture console output
|
|
|
Re: Can't use MT to capture console output [message #61202 is a reply to message #61189] |
Wed, 04 December 2024 10:34   |
cbpporter
Messages: 1428 Registered: September 2007
|
Ultimate Contributor |
|
|
I've tested on U++ 12587 and the test case I uploaded, unmodified, with an exe that prints 100k lines of code finishes almost instantly and gets captured, no Sleep needed.
With latest U++ this hangs or lags, as described.
With 1000 times as many outputs, both hang. But a Sleep of (1) on the old U++ version makes it super responsive, much better than Sleep(10) on the new U++.
Also, the old U++ is on an old PC. Read slow. I had to revive it from storage just for this test. The new one is on a cutting edge (from 3-4 years ago) Intel CPU. So the new U++ on new PC is more laggy than old U++ on old PC.
This reminds me of many years ago, when I was first trying to get this going and it was a complete mess. My solutions didn't work. If I remember correctly, I took inspiration from TheIDE sources and this single line fixed all the issues:
void Append(const String& s) {
Insert(total, s); // THIS
}
Inserting to "total" position and only there, made it work. I'm guessing that turns it into an "append", not an "insert".
I'll try and find an ever older U++ than 12587, and maybe one in the middle . But I doubt I'll find one.
|
|
|
|
Re: Can't use MT to capture console output [message #61765 is a reply to message #61203] |
Sat, 02 August 2025 13:57  |
cbpporter
Messages: 1428 Registered: September 2007
|
Ultimate Contributor |
|
|
I finally had time to do another full run of investigations.
While the PostCallback method is still not performing acceptably without a Sleep, I switched over to not using it and adding a GuiLock __.
This solved many of the problems. Still might be a bit slower than it used to be in the old days and builds, but barely.
Now I just need to rewrite the Thread stop conditions for this new approach, since there is a menu option to kill the thread and this one crashes when using GuiLock. Because the thread still keeps going.
A bit hacky my current method, need to rethink it. I have found no way to kill a Thread directly.
|
|
|
Goto Forum:
Current Time: Mon Aug 11 19:50:26 CEST 2025
Total time taken to generate the page: 0.05573 seconds
|