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 » AsyncWork, IsFinished() may not be working properly
Re: AsyncWork, IsFinished() may not be working properly [message #54433 is a reply to message #54431] Sat, 18 July 2020 16:44 Go to previous messageGo to previous message
JeyCi is currently offline  JeyCi
Messages: 50
Registered: July 2020
Member
Oblivion wrote on Sat, 18 July 2020 15:31
if the work is finished then Calling Get() won't wait either, it will immediately return the resultitng value of the offloaded computation.

Yes, now I see - this is important difference in your code comparing it with mine
and here
Oblivion wrote on Sat, 18 July 2020 15:31
while(!workers.IsEmpty())
for(int i = 0; i < workers.GetCount(); i++)

? is it duplication of loop & what for? why not use only one any row from these 2, not both?

Oblivion wrote on Sat, 18 July 2020 15:31
// No locking required, since we dont use a shared variable...

- well, I worried for a long time about this i - always doubting if it is shared variable - it always seems to me that counter itself is always shared & should be locked somehow when making i++... it's difficult to understand why not?..
Oblivion wrote on Sat, 18 July 2020 15:31
auto iota = w.Pick(); // Same as Get() but picks ("moves") the resulting vector.

- I liked this row Smile

[Updated on: Sat, 18 July 2020 17:17]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Skylark session verification
Next Topic: How do I create a loop for a window to react to volatile changes to a global variable?
Goto Forum:
  


Current Time: Sun Apr 28 11:52:11 CEST 2024

Total time taken to generate the page: 0.03133 seconds