[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.programming.threads

About Jsva and C# and Threadpool

Ramine

5/20/2015 11:02:00 PM

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#meth...


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# doesn'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.


You can download my efficient Threadpool Engine version 2.0 from:

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



Thank you,
Amine Moulay Ramdane.