Home » U++ Library support » U++ MT-multithreading and servers » what about WorkQueue : public CoWork
what about WorkQueue : public CoWork [message #24885] |
Wed, 03 February 2010 07:26 |
|
kohait00
Messages: 939 Registered: July 2009 Location: Germany
|
Experienced Contributor |
|
|
hi there..
recently got an idea..
there is type of work which should be done somewhere in a worker thread, but in given order. something like "run it somewhere, *not* in this thread, i dont care where, but keep the supplied order of work". to be sure that certain things dont get executed before other things, but they *do* execute somewhere in parallell to current thred. Does that make sense?
more or less the approach of PostCallback, but there is one decent thread running all the work sequentially. something like:
WorkQueue : public CoWork /*with only one thread*/
WorkQueue wq;
/*in any thread, main thread probably, offload work */
wq & THISBACK(A)
wq & THISBACK(B)
/*any other work*/
wq & THISBACK(C)
/*the single worker thread */
DoJob(A)
DoJob(B)
/*maybe done, sleeping */
DoJob(C)
...
hope you got the point. it's almost like CoWork, but suppying to CoWork one needs to have real paralellable work, one cant be sure of what is going to be executed first, what later.. depends..or at least it is really executed in parallel. (or am i wrong)
so deriving from CoWork would almost do it, if ensuring that only 1 thread is the worker thread there. (I know that CoWork uses a static Pool of threads. that needed to be tweaked)
benefit: one could set up a decent count of worker threads, that could be responsible for different type of work, that can be executed in parallell, but the work that is "dependant" would still execute sequentially. this would make life esier in some cases, not needing to provide a lot of IPC anymore. just by logical *pre* runtime separation of work.
comments please
|
|
|
|
|
what about WorkQueue : public CoWork
By: kohait00 on Wed, 03 February 2010 07:26
|
|
|
Re: what about WorkQueue : public CoWork
By: koldo on Wed, 03 February 2010 08:22
|
|
|
Re: what about WorkQueue : public CoWork
By: kohait00 on Wed, 03 February 2010 08:58
|
|
|
first, CoWork.h and CoWork.cpp cleanups
By: kohait00 on Wed, 03 February 2010 12:07
|
|
|
WorkQueue
By: kohait00 on Wed, 03 February 2010 12:14
|
|
|
Re: what about WorkQueue : public CoWork
By: mirek on Wed, 03 February 2010 12:36
|
|
|
Re: what about WorkQueue : public CoWork
By: kohait00 on Wed, 03 February 2010 13:31
|
|
|
changed CoWork and derived WorkQueue
By: kohait00 on Wed, 03 February 2010 15:03
|
|
|
Re: changed CoWork and derived WorkQueue
By: mirek on Wed, 03 February 2010 15:08
|
|
|
Re: changed CoWork and derived WorkQueue
By: kohait00 on Wed, 03 February 2010 15:14
|
|
|
Re: changed CoWork and derived WorkQueue
By: mirek on Wed, 03 February 2010 20:45
|
|
|
Re: changed CoWork and derived WorkQueue
By: kohait00 on Wed, 03 February 2010 21:58
|
|
|
2 basic problems
By: kohait00 on Mon, 08 February 2010 22:29
|
|
|
Re: changed CoWork and derived WorkQueue
By: mirek on Tue, 09 February 2010 10:56
|
|
|
Re: changed CoWork and derived WorkQueue
By: kohait00 on Tue, 09 February 2010 15:14
|
|
|
Re: changed CoWork and derived WorkQueue
By: mirek on Mon, 15 February 2010 12:49
|
|
|
Re: changed CoWork and derived WorkQueue
By: kohait00 on Tue, 16 February 2010 14:44
|
|
|
BUGFIX to WorkQueue
By: kohait00 on Thu, 18 February 2010 16:02
|
|
|
Re: BUGFIX to WorkQueue
By: kohait00 on Fri, 19 February 2010 08:47
|
Goto Forum:
Current Time: Sat May 04 14:36:08 CEST 2024
Total time taken to generate the page: 0.03413 seconds
|