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 » U++ community news and announcements » CoWork::FinLock
Re: CoWork::FinLock [message #45817 is a reply to message #45816] Sun, 10 January 2016 22:51 Go to previous message
mirek is currently offline  mirek
Messages: 14263
Registered: November 2005
Ultimate Member
For the record, here is the implementation with CoLoop listed here:

	int samples = 100000000;
	int count = 0;
	CoLoop(0, samples,
		[=, &count](int a, int b) {
			int lcount = 0;
			while(a < b) {
				double x = Randomf();
				double y = Randomf();
				if(sqrt(x*x + y*y) < 1)
					lcount++;
				a++;
			}
			CoWork::FinLock();
			count += lcount;
		}
	);
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Happy New Year 2016
Next Topic: TheIDE - Python syntax and indention support
Goto Forum:
  


Current Time: Mon Jun 30 07:41:32 CEST 2025

Total time taken to generate the page: 0.04573 seconds