Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » How to use CoWork and Progress together?
How to use CoWork and Progress together? [message #53511] Tue, 07 April 2020 14:58 Go to previous message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi,

I've been trying to make CoWork and Progress work nicely together, but I just can't figure out what have I done wrong:

	Progress pg;
	pg.Title("A parallel processing job");
	pg.SetText("Working on many items at once...");
	pg.Set(0, 100);
	
	Atomic done=0;

	CoWork co;

	co * [&] {
		for(int i = co.Next(); i < 100 ; i = co.Next()) {
			Sleep(100); // Doing something...
			
			// OK, now it is done, update progress:
			
			GuiLock _;
			pg.SetPos(AtomicInc(done));
		}
	};
	
	co.Finish();


Any suggestions how to make it work as it should? Now it just freezes at or near the end...

Best regards,

Tom
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: [NOT REPRODUCIBLE] HttpRequest gzip format error
Next Topic: ASyncWork/CoWork Cancel() method leads to deadlock (when used with GuiLock)
Goto Forum:
  


Current Time: Fri Mar 29 03:16:22 CET 2024

Total time taken to generate the page: 0.01359 seconds