Home > Back-end >  FutureTask asynchronous problem, a week, the white may not be the solution
FutureTask asynchronous problem, a week, the white may not be the solution

Time:12-28

We usually define FutureTask like this:
FutureTask Future1=new FutureTask<> (new FutureTest ());
FutureTask Future2=new FutureTask<> (new FutureTest ());

Through the thread pool commit:
The Future fs1=executorService. Submit (future1);
The Future fs1=executorService. Submit (future2);

This is two different instances of FutureTask,

In FutureTask internal implementation, use a lot of CAS lightweight lock, this is no need to, different instances have concurrent?
Mystery,
Guide also looked down, troubled for a week, thank you
  • Related