Suppose we have tow types of Task classes( First and Second )implementing Runnable. both of them have an access to a shared object (syncObj) which is supposed to be the Synchronization Object. we want to use just one Thread pool with any number of thread in such a way that Task of the class First have higher priority to class Second in the Execution. using Countdown latch or any other object how could I implement this problem ?
Asked
Active
Viewed 23 times
0
-
should we assume this is Java? Please use tag for language. why do you require only one pool ? And what is the role of this synchronization object ? The more locking you do, the less concurrency you get. – Nathan Hughes Aug 03 '21 at 15:09
-
yes it is in java. – Ali.Nemat Aug 03 '21 at 15:40