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 #54434 is a reply to message #54433] Sat, 18 July 2020 17:06 Go to previous messageGo to previous message
JeyCi is currently offline  JeyCi
Messages: 50
Registered: July 2020
Member
JeyCi wrote on Sat, 18 July 2020 16:44
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?

sorry to hurry with my question - I understood -
1 cycle "for" from the beginning till the end of the container;
second cycle (while) - to repeat again & again for-cycle from the beginning till the end of the container - until container IsEmpty... because after first for-loop some worker-threads can be still not finished... really logically

JeyCi wrote on Sat, 18 July 2020 16:44

- it always seems to me that counter itself is always shared & should be locked somehow when making i++...

but frankly speaking, if you insist that not, I can agree with you now... because this i (counter) is still in one (primary) thread, from where it is taken to workers - Geniusly... thanks a lot
===
after your example - more clear is now my view at threads...


Best regards.

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

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 01:16:45 CEST 2024

Total time taken to generate the page: 0.07915 seconds