Hello,

We have to be smart please, please look at the ThreadPoolExecutor Class of 
Java, look for example at the awaitTermination() method, it says:

---
boolean awaitTermination(long timeout, TimeUnit unit)

Blocks until all tasks have completed execution after a shutdown request, 
or the timeout occurs, or the current thread is interrupted, whichever 
happens first.
--

read more here: 

https://docs.oracle.com/javase/8/docs/api/java/util/concurrent/ThreadPoolExecutor.html#method.summary
Did you notice ?

In Java when you wait for the tasks you have to wait for "ALL" the tasks, 
and that's not efficient , and if you want to use the object from multiple 
threads i think it will have the same effect, you can avoid some of the 
problems by using many objects of the ThreadPoolExecutor class but this 
will take ressources and this will cause more and more context switches and 
that's bad, i think C# has the same problem, other than that Java and C# 
don't support priorities, it means that you can not give priorities to 
tasks/jobs, like high or normal or low, and that's not good for games and 
other applications where you have to use priorities even if the system is 
not a realtime system, this is why i have decided to implement my efficient 
Threadpool engine version 2.0 that supports those characteristics, so that 
you can create a child object of the Threadpool class that will use the 
same worker threads and that will wait only for the tasks that you will add 
with the execute() method , and also my efficient Threadpool engine 
supports 3 priorities, High and normal and low, that's where my efficient 
Threadpool engine comes in hand and that's where it's efficient. Hope you 
will like it.

And as  you have noticed i have implemented an efficient Threadpool engine 
version 2.0, also what i want to say in this post, is that i have made it 
smart like a smart automaton with states and transitions that will guide 
you using exception handling so that to avoid the forbiden transitions. I 
have enhanced the automaton and i think that it's efficient now, please 
read the HTML tutorial inside the zip file to understand how to use the 
execute() and setCounter() and wait() methods etc.


You can download my efficient Threadpool Engine version 2.0 from:



https://sites.google.com/site/aminer68/threadpool-with-priorities 

Thank you,
Amine Moulay Ramdane.


On Wednesday, May 20, 2015 at 9:15:30 AM UTC-7, Amine Moulay Ramdane wrote:
>
> Hello... 
>
>
> I have finally implemented an efficient Threadpool engine version 2.0, 
> this version is really efficient because you can give priorities to your 
> jobs that you will distribute to the Threadpool, and when you give for 
> example a high priority for the jobs , the jobs of the high priority will 
> be executed faster and the response time will be lower, also when you 
> distribute your jobs in a thread and you wait for them, you will wait only 
> for those jobs to finish , you will not wait for all the jobs inside the 
> Threadpool engine to finish, and that's efficient, other than that my 
> efficient Threadpool engine with priorities has given a throughput of 3.2 
> millions of transactions per second and that's great ! 
>
> I have added 3 methods to my efficient Threadpool engine, now you can wait 
> for the jobs to finish with the wait() method, please read the HTML 
> tutorial inside the zip file to understand more how to use my efficient 
> Threadpool engine... 
>
>
> You can download my efficient Threadpool Engine version 2.0 from: 
>
> https://sites.google.com/site/aminer68/threadpool-with-priorities 
>
>
>
> And please click on the small arrow on the right of the zip file to 
> download.. 
>
>
> Thank you, 
> Amine Moulay Ramdane. 
>
>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"Scalable Synchronization Algorithms" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/lock-free/13d03cd1-9a02-47f1-9c29-2fc804133d0e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to