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 » Community » Newbie corner » Simple Thread (simple thread example.)
Re: Simple Thread [message #55033 is a reply to message #55023] Mon, 05 October 2020 19:04 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1094
Registered: August 2007
Senior Contributor
Klugier has put it nicely.

However, there is an even simpler way if you need async behaviour, using AsyncWork worker threads.

CONSOLE_APP_MAIN
{
	auto Boucle = [](String parametres) -> void
	{
		for (int i = 0; i < parametres.GetLength(); ++i)
		{
			Cout() << String(parametres[i], 1) << ",";
		}
	};
	
	Async(Boucle, "Hello world").Get();
}


Note that AsyncWork is the Upp interpretation and implementation of future/promise pattern and there are other ways to utilize it.

Best regards,
Oblivion


[Updated on: Mon, 05 October 2020 19:25]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to load your GridCtrl in background thread
Next Topic: Translation files
Goto Forum:
  


Current Time: Thu May 23 08:45:32 CEST 2024

Total time taken to generate the page: 0.01412 seconds