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 » what about WorkQueue : public CoWork
first, CoWork.h and CoWork.cpp cleanups [message #24892 is a reply to message #24889] Wed, 03 February 2010 12:07 Go to previous messageGo to previous message
kohait00 is currently offline  kohait00
Messages: 939
Registered: July 2009
Location: Germany
Experienced Contributor
during study of CoWork class stuff, i stumbeled oacross some small grains..which is but of beaty reasons Smile

1) static Pool::ThreadRun and static Pool::DoJob
why should they be static, the Pool itself is generatet in CoWork environment, so for capsulation reasons they can run on their own class instance. thats also why p = pool() stuff has been removed, because now linked to class itself. Has that had a reason which I havent seen? (this would also make sense to one day, if WorkQueue should really rely on CoWork, be able to use same Pool class (but different instnce Smile

2) some == and <= and the like stuff, implicit bool...has been explicited

3) while(todo)
if(todo == 0)
break;
makes no sense, it wont ever be true, since Finish() holds lock and no other thread can decrement it meanwhile

these are basicly changes, that made sense for me..commit if it makes sense..

next post is the WorkQueue
  • Attachment: CoWork.h
    (Size: 0.82KB, Downloaded 400 times)
  • Attachment: CoWork.cpp
    (Size: 2.78KB, Downloaded 645 times)
 
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
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: DnD hangs in MT Refresh()ing
Next Topic: Linux MT problems with time functions
Goto Forum:
  


Current Time: Thu Aug 28 15:47:31 CEST 2025

Total time taken to generate the page: 0.06765 seconds